Card vertical brand
A centred heading over an email signup in a brand-colour card.
Last updated
---
/**
* Card vertical brand: A centred heading over an email signup in a brand-colour card.
*
* @block newsletter
* @order 8
*/
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 Input from '@/components/apogee/Input/Input.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { NewsletterContent } from '@/components/apogee/sections/_shared/newsletter.ts'
/** @composable */
interface Props extends NewsletterContent {}
const {
eyebrow,
heading = 'Still thinking about it?',
description = 'Sign up for our newsletter and get 10% off your next purchase.',
submitLabel = 'Subscribe',
} = Astro.props
---
<Section spacing="large">
<div class="flex flex-col items-center gap-8 rounded-2xl px-6 py-10 lg:p-16 bg-primary text-on-primary">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} size="large" align="center" background="primary" />
<form method="post" class="flex w-full max-w-md flex-col gap-2 mx-auto text-center">
<div class="flex flex-col gap-3 md: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">Read about our <Link href="#" color="inherit">privacy policy</Link>.</p>
</form>
</div>
</Section>
Show codeHide code
---
/**
* Card vertical brand: A centred heading over an email signup in a brand-colour card.
*
* @block newsletter
* @order 8
*/
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 Input from '@/components/apogee/Input/Input.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { NewsletterContent } from '@/components/apogee/sections/_shared/newsletter.ts'
/** @composable */
interface Props extends NewsletterContent {}
const {
eyebrow,
heading = 'Still thinking about it?',
description = 'Sign up for our newsletter and get 10% off your next purchase.',
submitLabel = 'Subscribe',
} = Astro.props
---
<Section spacing="large">
<div class="flex flex-col items-center gap-8 rounded-2xl px-6 py-10 lg:p-16 bg-primary text-on-primary">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} size="large" align="center" background="primary" />
<form method="post" class="flex w-full max-w-md flex-col gap-2 mx-auto text-center">
<div class="flex flex-col gap-3 md: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">Read about our <Link href="#" color="inherit">privacy policy</Link>.</p>
</form>
</div>
</Section>Add
npx @ava-ui/apogee add newsletter/card-vertical-brand
This copies the block to src/components/apogee/blocks/newsletter/ 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 an
h2by default, so the block slots into a page under itsh1; item titles are one level down. - The email field is named “Email” (the placeholder is not a label); the form submits without JS.
Related
InputA labeled text field with hint/error messaging, wired for accessibility — plus a pure-CSS floating label.
ButtonTriggers an action. Renders a <button>, or an <a> when href is set. Hue, fill and height are three separate props.
DeviceFrameA screenshot in a phone, a landscape tablet or a browser window, drawn in CSS with the theme's colours; it scales as a whole and a dark screenshot swaps in with the theme.