Form and image 02
A photo beside a heading, an email link and a contact form with a services checklist.
Last updated
---
/**
* Form and image 02: A photo beside a heading, an email link and a contact form with a services checklist.
*
* @block contact
* @order 4
*/
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import ContactForm from '@/components/apogee/ContactForm/ContactForm.astro'
import Image from '@/components/apogee/Image/Image.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { ContactContent } from '@/components/apogee/sections/_shared/contact.ts'
/** @composable */
interface Props extends ContactContent {
/** 1 when the block opens a page; its items move one level down with it. */
headingLevel?: 1 | 2
/** Linked after the description. @category content */
email?: string | null
}
const {
headingLevel = 2,
heading = "Let's level up your brand, together",
description = 'You can reach us anytime via',
email = 'hi@example.com',
media = { src: 'https://picsum.photos/seed/apogee-contact-2/1200/1600', alt: '', width: 1200, height: 1600 },
action,
method,
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="none" container={false}>
<div class="grid lg:grid-cols-2">
{media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" class="h-full min-h-[50rem] w-full max-lg:hidden" />}
<div class="px-gutter py-section lg:px-16">
<div class="mx-auto max-w-lg">
<SectionHeader headingLevel={headingLevel} heading={plain(heading)} class="mb-4" />
{(description || email) && <p class="mb-12 text-neutral-faded">{description} {email && <Link href={`mailto:${email}`}>{email}</Link>}</p>}
<ContactForm services={['Website design', 'Content creation', 'UX design', 'Strategy & consulting', 'User research', 'Other']} action={action} method={method} submitLabel={submitLabel} />
</div>
</div>
</div>
</Section>
Show codeHide code
---
/**
* Form and image 02: A photo beside a heading, an email link and a contact form with a services checklist.
*
* @block contact
* @order 4
*/
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import ContactForm from '@/components/apogee/ContactForm/ContactForm.astro'
import Image from '@/components/apogee/Image/Image.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { ContactContent } from '@/components/apogee/sections/_shared/contact.ts'
/** @composable */
interface Props extends ContactContent {
/** 1 when the block opens a page; its items move one level down with it. */
headingLevel?: 1 | 2
/** Linked after the description. @category content */
email?: string | null
}
const {
headingLevel = 2,
heading = "Let's level up your brand, together",
description = 'You can reach us anytime via',
email = 'hi@example.com',
media = { src: 'https://picsum.photos/seed/apogee-contact-2/1200/1600', alt: '', width: 1200, height: 1600 },
action,
method,
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="none" container={false}>
<div class="grid lg:grid-cols-2">
{media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" class="h-full min-h-[50rem] w-full max-lg:hidden" />}
<div class="px-gutter py-section lg:px-16">
<div class="mx-auto max-w-lg">
<SectionHeader headingLevel={headingLevel} heading={plain(heading)} class="mb-4" />
{(description || email) && <p class="mb-12 text-neutral-faded">{description} {email && <Link href={`mailto:${email}`}>{email}</Link>}</p>}
<ContactForm services={['Website design', 'Content creation', 'UX design', 'Strategy & consulting', 'User research', 'Other']} action={action} method={method} submitLabel={submitLabel} />
</div>
</div>
</div>
</Section>Add
npx @ava-ui/apogee add contact/form-and-image-02
This copies the block to src/components/apogee/blocks/contact/ with everything it uses: ContactForm, Image, Link, 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.