Left email brand
A left-aligned heading, line and email signup on the brand colour.
Last updated
---
/**
* Left email brand: A left-aligned heading, line and email signup on the brand colour.
*
* @block header
* @order 16
*/
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Button from '@/components/apogee/Button/Button.astro'
import Link from '@/components/apogee/Link/Link.astro'
import Input from '@/components/apogee/Input/Input.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PageHeaderContent } from '@/components/apogee/sections/_shared/header.ts'
/** @composable */
interface Props extends PageHeaderContent {
/** The email form button. @category content */
submitLabel?: string
}
const {
eyebrow = 'Resources',
heading = 'The Larkspur blog',
description = 'The latest industry news, technologies and resources from our team.',
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="large" background="primary">
<div class="flex flex-col gap-8 md:gap-12 items-start">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} headingLevel={1} size="large" background="primary" />
<form method="post" class="flex w-full max-w-md flex-col gap-2">
<div class="flex flex-col gap-3 sm:flex-row">
<Input type="email" name="email" placeholder="Enter your email" aria-label="Email" autocomplete="email" required size="large" class="flex-1 text-start" />
<Button type="submit" size="large" color="neutral">{submitLabel}</Button>
</div>
<p class="text-sm opacity-85">We care about your data in our <Link href="#" color="inherit">privacy policy</Link>.</p>
</form>
</div>
</Section>
Show codeHide code
---
/**
* Left email brand: A left-aligned heading, line and email signup on the brand colour.
*
* @block header
* @order 16
*/
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Button from '@/components/apogee/Button/Button.astro'
import Link from '@/components/apogee/Link/Link.astro'
import Input from '@/components/apogee/Input/Input.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PageHeaderContent } from '@/components/apogee/sections/_shared/header.ts'
/** @composable */
interface Props extends PageHeaderContent {
/** The email form button. @category content */
submitLabel?: string
}
const {
eyebrow = 'Resources',
heading = 'The Larkspur blog',
description = 'The latest industry news, technologies and resources from our team.',
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="large" background="primary">
<div class="flex flex-col gap-8 md:gap-12 items-start">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} headingLevel={1} size="large" background="primary" />
<form method="post" class="flex w-full max-w-md flex-col gap-2">
<div class="flex flex-col gap-3 sm:flex-row">
<Input type="email" name="email" placeholder="Enter your email" aria-label="Email" autocomplete="email" required size="large" class="flex-1 text-start" />
<Button type="submit" size="large" color="neutral">{submitLabel}</Button>
</div>
<p class="text-sm opacity-85">We care about your data in our <Link href="#" color="inherit">privacy policy</Link>.</p>
</form>
</div>
</Section>Add
npx @ava-ui/apogee add header/left-email-brand
This copies the block to src/components/apogee/blocks/header/ with everything it uses: Button, Input, 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 the page’s
h1; the items below are one level down. - The email field is named “Email” (the placeholder is not a label); the form submits without JS.
Related
SectionHeaderEyebrow, heading and description at the top of a section or an app page, with actions, a divider and the level, alignment and colours every section shares.
EyebrowA small label above a heading, for section tags and category kickers.
SegmentedControlA row of connected, mutually exclusive options backed by native radios — pick one from a small, always-visible set.