Card mockup 09
A heading and two buttons beside four payment cards on a panel.
Last updated
---
/**
* Card mockup 09: A heading and two buttons beside four payment cards on a panel.
*
* @block hero
* @order 37
*/
import { ArrowRight, CirclePlay } from '@lucide/astro'
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 Badge from '@/components/apogee/Badge/Badge.astro'
import PaymentCard from '@/components/apogee/PaymentCard/PaymentCard.astro'
import { plain, type HeroContent } from '@/components/apogee/sections/_shared/spine.ts'
/** @composable */
interface Props extends HeroContent {}
const {
announcement = { badge: 'New!', label: 'Download the new iOS app', href: '#' },
heading = 'Smart business credit cards',
description = 'A new kind of business account: cards, payments and reports in one place. Start with a 30-day free trial.',
primaryAction = { label: 'Sign up', href: '#' },
secondaryAction = { label: 'Demo', href: '#' },
} = Astro.props
---
<Section spacing="large">
<div class="grid items-center gap-12 lg:gap-16 lg:grid-cols-2">
<div class="flex flex-col gap-8 md:gap-12">
<div class="flex flex-col gap-4 md:gap-6 items-start">
{announcement && (
<Link href={announcement.href} color="inherit" underline="none" class="inline-flex items-center gap-2 self-start rounded-full py-1 ps-1 pe-3 text-sm font-medium bg-primary-faded text-primary">
{announcement.badge && <Badge color="primary" rounded>{announcement.badge}</Badge>}{announcement.label}<ArrowRight class="size-4 rtl:-scale-x-100" aria-hidden="true" />
</Link>
)}
<Heading as="h1" size="display" class="text-balance">{plain(heading)}</Heading>
{description && <p class="max-w-2xl text-lg md:text-xl text-neutral-faded">{description}</p>}
</div>
{(primaryAction || secondaryAction) && (
<div class="flex flex-col-reverse gap-3 sm:flex-row ">
{secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral"><CirclePlay slot="start" aria-hidden="true" />{secondaryAction.label}</Button>}
{primaryAction && <Button href={primaryAction.href} size="large">{primaryAction.label}</Button>}
</div>
)}
</div>
<div class="relative flex items-center justify-center overflow-hidden rounded-3xl bg-neutral-faded p-6 md:p-10 h-96 md:h-120">
<div class="relative h-full w-full max-w-lg">
<div class="absolute w-56 md:w-72 start-0 top-0"><PaymentCard variant="glass" last4="1001" /></div>
<div class="absolute w-56 md:w-72 start-[10%] top-[18%]"><PaymentCard color="neutral" last4="2002" /></div>
<div class="absolute w-56 md:w-72 start-[20%] top-[36%]"><PaymentCard variant="glass" last4="3003" /></div>
<div class="absolute w-56 md:w-72 start-[30%] top-[54%]"><PaymentCard color="primary" last4="4242" /></div>
</div>
</div>
</div>
</Section>
Show codeHide code
---
/**
* Card mockup 09: A heading and two buttons beside four payment cards on a panel.
*
* @block hero
* @order 37
*/
import { ArrowRight, CirclePlay } from '@lucide/astro'
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 Badge from '@/components/apogee/Badge/Badge.astro'
import PaymentCard from '@/components/apogee/PaymentCard/PaymentCard.astro'
import { plain, type HeroContent } from '@/components/apogee/sections/_shared/spine.ts'
/** @composable */
interface Props extends HeroContent {}
const {
announcement = { badge: 'New!', label: 'Download the new iOS app', href: '#' },
heading = 'Smart business credit cards',
description = 'A new kind of business account: cards, payments and reports in one place. Start with a 30-day free trial.',
primaryAction = { label: 'Sign up', href: '#' },
secondaryAction = { label: 'Demo', href: '#' },
} = Astro.props
---
<Section spacing="large">
<div class="grid items-center gap-12 lg:gap-16 lg:grid-cols-2">
<div class="flex flex-col gap-8 md:gap-12">
<div class="flex flex-col gap-4 md:gap-6 items-start">
{announcement && (
<Link href={announcement.href} color="inherit" underline="none" class="inline-flex items-center gap-2 self-start rounded-full py-1 ps-1 pe-3 text-sm font-medium bg-primary-faded text-primary">
{announcement.badge && <Badge color="primary" rounded>{announcement.badge}</Badge>}{announcement.label}<ArrowRight class="size-4 rtl:-scale-x-100" aria-hidden="true" />
</Link>
)}
<Heading as="h1" size="display" class="text-balance">{plain(heading)}</Heading>
{description && <p class="max-w-2xl text-lg md:text-xl text-neutral-faded">{description}</p>}
</div>
{(primaryAction || secondaryAction) && (
<div class="flex flex-col-reverse gap-3 sm:flex-row ">
{secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral"><CirclePlay slot="start" aria-hidden="true" />{secondaryAction.label}</Button>}
{primaryAction && <Button href={primaryAction.href} size="large">{primaryAction.label}</Button>}
</div>
)}
</div>
<div class="relative flex items-center justify-center overflow-hidden rounded-3xl bg-neutral-faded p-6 md:p-10 h-96 md:h-120">
<div class="relative h-full w-full max-w-lg">
<div class="absolute w-56 md:w-72 start-0 top-0"><PaymentCard variant="glass" last4="1001" /></div>
<div class="absolute w-56 md:w-72 start-[10%] top-[18%]"><PaymentCard color="neutral" last4="2002" /></div>
<div class="absolute w-56 md:w-72 start-[20%] top-[36%]"><PaymentCard variant="glass" last4="3003" /></div>
<div class="absolute w-56 md:w-72 start-[30%] top-[54%]"><PaymentCard color="primary" last4="4242" /></div>
</div>
</div>
</div>
</Section>Add
npx @ava-ui/apogee add hero/card-mockup-09
This copies the block to src/components/apogee/blocks/hero/ with everything it uses: Badge, Button, Heading, Link, PaymentCard, 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. - Each payment card is one image, named by its last four digits.
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.