Color card 01
A centred heading and email signup on a brand card, over a chart.
Last updated
---
/**
* Color card 01: A centred heading and email signup on a brand card, over a chart.
*
* @block hero
* @order 25
*/
import Section from '@/components/apogee/Section/Section.astro'
import Heading from '@/components/apogee/Heading/Heading.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 CircularProgress from '@/components/apogee/CircularProgress/CircularProgress.astro'
import { plain, type HeroContent } from '@/components/apogee/sections/_shared/spine.ts'
/** @composable */
interface Props extends HeroContent {
/** The form's submit button. @category content */
submitLabel?: string
}
const {
heading = 'Grow your users. Smarter.',
description = 'Powerful, self-serve product and growth analytics to help you convert, engage and retain more users. Trusted by over 4,000 startups.',
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="large">
<div class="rounded-none bg-primary px-6 py-12 text-on-primary md:rounded-3xl md:px-12 md:py-16 ">
<div class="flex flex-col gap-8 md:gap-12 items-center text-center">
<div class="flex flex-col gap-4 md:gap-6 items-center text-center">
<Heading as="h1" size="display" class="text-balance">{plain(heading)}</Heading>
{description && <p class="max-w-2xl text-lg md:text-xl opacity-85">{description}</p>}
</div>
<form method="post" class="flex w-full max-w-md flex-col gap-2 mx-auto">
<div class="flex flex-col gap-3 md:flex-row">
<Input size="large" type="email" name="email" placeholder="Enter your email" aria-label="Email" autocomplete="email" required class="flex-1" />
<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>
</div>
<div class="-mt-10 flex justify-center px-4 md:-mt-16"><div class="relative w-full max-w-xl pb-10">
<div class="rounded-2xl bg-elevation-raised p-6 text-neutral shadow-raised ring-1 ring-neutral" role="img" aria-label="Users over time: rising from about 2,100 in January to 4,000 in December">
<p class="font-semibold">Users over time</p>
<div class="mt-6 flex h-40 items-end gap-1.5 md:h-52">
{[52, 48, 58, 55, 63, 60, 70, 74, 71, 82, 88, 100].map((h) => <span class="flex-1 rounded-t-sm bg-primary" style={`height: ${h}%`}></span>)}
</div>
<div class="mt-2 flex justify-between text-xs text-neutral-faded"><span>Jan</span><span>Jun</span><span>Dec</span></div>
</div>
<div class="absolute end-4 bottom-0 flex items-center gap-4 rounded-2xl bg-elevation-raised p-4 text-neutral shadow-raised ring-1 ring-neutral">
<CircularProgress value={72} label="Active users" size="large" />
<div><p class="text-sm text-neutral-faded">Active users</p><p class="text-xl font-semibold tabular-nums">1,000</p></div>
</div>
</div></div>
</Section>
Show codeHide code
---
/**
* Color card 01: A centred heading and email signup on a brand card, over a chart.
*
* @block hero
* @order 25
*/
import Section from '@/components/apogee/Section/Section.astro'
import Heading from '@/components/apogee/Heading/Heading.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 CircularProgress from '@/components/apogee/CircularProgress/CircularProgress.astro'
import { plain, type HeroContent } from '@/components/apogee/sections/_shared/spine.ts'
/** @composable */
interface Props extends HeroContent {
/** The form's submit button. @category content */
submitLabel?: string
}
const {
heading = 'Grow your users. Smarter.',
description = 'Powerful, self-serve product and growth analytics to help you convert, engage and retain more users. Trusted by over 4,000 startups.',
submitLabel = 'Get started',
} = Astro.props
---
<Section spacing="large">
<div class="rounded-none bg-primary px-6 py-12 text-on-primary md:rounded-3xl md:px-12 md:py-16 ">
<div class="flex flex-col gap-8 md:gap-12 items-center text-center">
<div class="flex flex-col gap-4 md:gap-6 items-center text-center">
<Heading as="h1" size="display" class="text-balance">{plain(heading)}</Heading>
{description && <p class="max-w-2xl text-lg md:text-xl opacity-85">{description}</p>}
</div>
<form method="post" class="flex w-full max-w-md flex-col gap-2 mx-auto">
<div class="flex flex-col gap-3 md:flex-row">
<Input size="large" type="email" name="email" placeholder="Enter your email" aria-label="Email" autocomplete="email" required class="flex-1" />
<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>
</div>
<div class="-mt-10 flex justify-center px-4 md:-mt-16"><div class="relative w-full max-w-xl pb-10">
<div class="rounded-2xl bg-elevation-raised p-6 text-neutral shadow-raised ring-1 ring-neutral" role="img" aria-label="Users over time: rising from about 2,100 in January to 4,000 in December">
<p class="font-semibold">Users over time</p>
<div class="mt-6 flex h-40 items-end gap-1.5 md:h-52">
{[52, 48, 58, 55, 63, 60, 70, 74, 71, 82, 88, 100].map((h) => <span class="flex-1 rounded-t-sm bg-primary" style={`height: ${h}%`}></span>)}
</div>
<div class="mt-2 flex justify-between text-xs text-neutral-faded"><span>Jan</span><span>Jun</span><span>Dec</span></div>
</div>
<div class="absolute end-4 bottom-0 flex items-center gap-4 rounded-2xl bg-elevation-raised p-4 text-neutral shadow-raised ring-1 ring-neutral">
<CircularProgress value={72} label="Active users" size="large" />
<div><p class="text-sm text-neutral-faded">Active users</p><p class="text-xl font-semibold tabular-nums">1,000</p></div>
</div>
</div></div>
</Section>Add
npx @ava-ui/apogee add hero/color-card-01
This copies the block to src/components/apogee/blocks/hero/ with everything it uses: Button, CircularProgress, Heading, Input, Link, Section. 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
SectionA full-width band with vertical rhythm and an optional Container, used to lay out page content.
HeadingA semantic, fluid-sized heading — pick the tag with `as`, the visual size with `size`.
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.