Simple accent line brand
A centred heading over four figures, each with an accent line and a link, on the brand colour.
Last updated
---
/**
* Simple accent line brand: A centred heading over four figures, each with an accent line and a link, on the brand colour.
*
* @block metrics
* @order 8
*/
import { ArrowRight, Zap } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { MetricsContent, MetricItem } from '@/components/apogee/sections/_shared/metrics.ts'
/** @composable */
interface Props extends MetricsContent {
/** The figures; a figure's link shows when it has an `href`. @category content */
items?: (MetricItem & { href?: string; linkLabel?: string })[]
}
const {
heading = 'Build something great',
description = 'Everything you need to build modern interfaces and great products.',
items = [
{ value: '400+', label: 'Projects completed', href: '#', linkLabel: 'View projects' },
{ value: '600%', label: 'Return on investment', href: '#', linkLabel: 'Read the study' },
{ value: '10k', label: 'Global downloads', href: '#', linkLabel: 'Download now' },
{ value: '200+', label: 'Five-star reviews', href: '#', linkLabel: 'View reviews' },
],
} = Astro.props
---
<Section spacing="large" background="primary">
<div class="flex flex-col gap-12 md:gap-16">
<div class="flex flex-col items-center gap-4 md:gap-6">
<FeaturedIcon theme="solid" color="neutral" size="xlarge"><Zap /></FeaturedIcon>
<SectionHeader heading={plain(heading)} description={description ?? undefined} size="large" align="center" background="primary" />
</div>
<dl class="flex flex-col gap-10 md:flex-row md:justify-between md:gap-8">
{items.map((s) => (
<div class="border-t-2 pt-6 md:border-t-0 md:border-s-2 md:ps-6 md:pt-0 border-current/40">
<div class="flex flex-col gap-3">
<dt class="order-2 text-lg font-semibold">{s.label}</dt>
<dd class="order-1 text-5xl font-semibold tracking-tight tabular-nums md:text-6xl ">{s.value}</dd>
{s.href && <dd class="order-4 mt-2"><Link href={s.href} color="inherit" class="inline-flex items-center gap-1 font-semibold">{s.linkLabel}<ArrowRight class="size-4 rtl:-scale-x-100" aria-hidden="true" /></Link></dd>}
</div>
</div>
))}
</dl>
</div>
</Section>
Show codeHide code
---
/**
* Simple accent line brand: A centred heading over four figures, each with an accent line and a link, on the brand colour.
*
* @block metrics
* @order 8
*/
import { ArrowRight, Zap } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Link from '@/components/apogee/Link/Link.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { MetricsContent, MetricItem } from '@/components/apogee/sections/_shared/metrics.ts'
/** @composable */
interface Props extends MetricsContent {
/** The figures; a figure's link shows when it has an `href`. @category content */
items?: (MetricItem & { href?: string; linkLabel?: string })[]
}
const {
heading = 'Build something great',
description = 'Everything you need to build modern interfaces and great products.',
items = [
{ value: '400+', label: 'Projects completed', href: '#', linkLabel: 'View projects' },
{ value: '600%', label: 'Return on investment', href: '#', linkLabel: 'Read the study' },
{ value: '10k', label: 'Global downloads', href: '#', linkLabel: 'Download now' },
{ value: '200+', label: 'Five-star reviews', href: '#', linkLabel: 'View reviews' },
],
} = Astro.props
---
<Section spacing="large" background="primary">
<div class="flex flex-col gap-12 md:gap-16">
<div class="flex flex-col items-center gap-4 md:gap-6">
<FeaturedIcon theme="solid" color="neutral" size="xlarge"><Zap /></FeaturedIcon>
<SectionHeader heading={plain(heading)} description={description ?? undefined} size="large" align="center" background="primary" />
</div>
<dl class="flex flex-col gap-10 md:flex-row md:justify-between md:gap-8">
{items.map((s) => (
<div class="border-t-2 pt-6 md:border-t-0 md:border-s-2 md:ps-6 md:pt-0 border-current/40">
<div class="flex flex-col gap-3">
<dt class="order-2 text-lg font-semibold">{s.label}</dt>
<dd class="order-1 text-5xl font-semibold tracking-tight tabular-nums md:text-6xl ">{s.value}</dd>
{s.href && <dd class="order-4 mt-2"><Link href={s.href} color="inherit" class="inline-flex items-center gap-1 font-semibold">{s.linkLabel}<ArrowRight class="size-4 rtl:-scale-x-100" aria-hidden="true" /></Link></dd>}
</div>
</div>
))}
</dl>
</div>
</Section>Add
npx @ava-ui/apogee add metrics/simple-accent-line-brand
This copies the block to src/components/apogee/blocks/metrics/ with everything it uses: FeaturedIcon, 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.
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.
Featured iconAn icon in a tinted tile, the glyph that leads an empty state, an alert, a stat or a feature card.
StatsHeadline numbers in a row or as cards.