Icon cards 03
A centred heading and a wide photo over three contact cards.
Last updated
---
/**
* Icon cards 03: A centred heading and a wide photo over three contact cards.
*
* @block contact
* @order 20
*/
import { LifeBuoy, Mail, MapPin, MessageCircle, MessagesSquare, Phone } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import ContactMethod from '@/components/apogee/ContactMethod/ContactMethod.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Image from '@/components/apogee/Image/Image.astro'
import Badge from '@/components/apogee/Badge/Badge.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { ContactContent } from '@/components/apogee/sections/_shared/contact.ts'
const icons = { mail: Mail, phone: Phone, 'map-pin': MapPin, 'message-circle': MessageCircle, 'messages-square': MessagesSquare, 'life-buoy': LifeBuoy } as const
/** @composable */
interface Props extends ContactContent {}
const {
eyebrow = 'Contact us',
heading = "We'd love to hear from you",
description = 'Our friendly team is always here to chat.',
details = [
{ icon: 'messages-square', label: 'Chat to sales', description: 'Speak to our friendly team.', value: 'sales@example.com', href: 'mailto:sales@example.com' },
{ icon: 'map-pin', label: 'Visit us', description: 'Visit our office HQ.', value: 'View on the map', href: '#map' },
{ icon: 'phone', label: 'Call us', description: 'Mon–Fri from 8am to 5pm.', value: '+1 (555) 000-0000', href: 'tel:+15550000000' },
],
media = { src: 'https://picsum.photos/seed/apogee-contact-4/1600/700', alt: '', width: 1600, height: 700 },
} = Astro.props
---
<Section spacing="large">
<div class="mx-auto mb-12 flex max-w-3xl flex-col items-center gap-4 text-center">
{eyebrow && <Badge color="primary" rounded>{eyebrow}</Badge>}
<SectionHeader heading={plain(heading)} description={description ?? undefined} align="center" />
</div>
{media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" radius="xl" class="mb-16 aspect-[16/7] w-full" />}
{details && <ul class="list-none p-0 grid gap-6 md:grid-cols-3">
{details.map((d) => {
const Icon = icons[d.icon]
return <li><ContactMethod title={d.label} description={d.description} link={d.href ? { label: d.value, href: d.href } : undefined} variant="card"><FeaturedIcon slot="icon" theme="outline" color="neutral"><Icon /></FeaturedIcon>{!d.href && <p>{d.value}</p>}</ContactMethod></li>
})}
</ul>}
</Section>
Show codeHide code
---
/**
* Icon cards 03: A centred heading and a wide photo over three contact cards.
*
* @block contact
* @order 20
*/
import { LifeBuoy, Mail, MapPin, MessageCircle, MessagesSquare, Phone } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import ContactMethod from '@/components/apogee/ContactMethod/ContactMethod.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Image from '@/components/apogee/Image/Image.astro'
import Badge from '@/components/apogee/Badge/Badge.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { ContactContent } from '@/components/apogee/sections/_shared/contact.ts'
const icons = { mail: Mail, phone: Phone, 'map-pin': MapPin, 'message-circle': MessageCircle, 'messages-square': MessagesSquare, 'life-buoy': LifeBuoy } as const
/** @composable */
interface Props extends ContactContent {}
const {
eyebrow = 'Contact us',
heading = "We'd love to hear from you",
description = 'Our friendly team is always here to chat.',
details = [
{ icon: 'messages-square', label: 'Chat to sales', description: 'Speak to our friendly team.', value: 'sales@example.com', href: 'mailto:sales@example.com' },
{ icon: 'map-pin', label: 'Visit us', description: 'Visit our office HQ.', value: 'View on the map', href: '#map' },
{ icon: 'phone', label: 'Call us', description: 'Mon–Fri from 8am to 5pm.', value: '+1 (555) 000-0000', href: 'tel:+15550000000' },
],
media = { src: 'https://picsum.photos/seed/apogee-contact-4/1600/700', alt: '', width: 1600, height: 700 },
} = Astro.props
---
<Section spacing="large">
<div class="mx-auto mb-12 flex max-w-3xl flex-col items-center gap-4 text-center">
{eyebrow && <Badge color="primary" rounded>{eyebrow}</Badge>}
<SectionHeader heading={plain(heading)} description={description ?? undefined} align="center" />
</div>
{media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" radius="xl" class="mb-16 aspect-[16/7] w-full" />}
{details && <ul class="list-none p-0 grid gap-6 md:grid-cols-3">
{details.map((d) => {
const Icon = icons[d.icon]
return <li><ContactMethod title={d.label} description={d.description} link={d.href ? { label: d.value, href: d.href } : undefined} variant="card"><FeaturedIcon slot="icon" theme="outline" color="neutral"><Icon /></FeaturedIcon>{!d.href && <p>{d.value}</p>}</ContactMethod></li>
})}
</ul>}
</Section>Add
npx @ava-ui/apogee add contact/icon-cards-03
This copies the block to src/components/apogee/blocks/contact/ with everything it uses: Badge, ContactMethod, FeaturedIcon, Image, Section, SectionHeader. Every piece of copy is a prop, with the sample copy as its default. Pass yours, or null to hide a part; see copy is props.
Accessibility
- The heading is an
h2by default, so the block slots into a page under itsh1; item titles are one level down. - Photos that only decorate have an empty
alt; give yours one when it carries meaning.
Related
ContactFormThe message form contact pages share; names, email, an optional phone with a country code, the message, an optional services checklist and a privacy checkbox.
ContactMethodOne way to reach you; an icon, a title, a line about it and the address, number or link, plain or on a card.
MapEmbedAn embedded street map centred on a place, with a marker and a link to the full map; no key, no script.
WorldMapA dotted world map with office pins; each pin names its place on hover or focus and links to it on a full map.