Simple centered text brand
A centred heading over three figures split by dividers, on the brand colour.
Last updated
---
/**
* Simple centered text brand: A centred heading over three figures split by dividers, on the brand colour.
*
* @block metrics
* @order 10
*/
import { 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 { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { MetricsContent } from '@/components/apogee/sections/_shared/metrics.ts'
/** @composable */
interface Props extends MetricsContent {}
const {
heading = 'Build something great',
description = 'Everything you need to build modern interfaces and great products.',
items = [
{ value: '400+', label: 'Projects completed' },
{ value: '600%', label: 'Return on investment' },
{ value: '10k', label: 'Global downloads' },
],
} = 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="mx-auto flex w-full max-w-3xl flex-col gap-8 md:flex-row md:gap-0 [&>*]:flex-1 md:[&>*+*]:border-s md:[&>*+*]:border-current/25">
{items.map((s) => (
<div class="flex flex-col gap-3 items-center text-center">
<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>
</div>
))}
</dl>
</div>
</Section>
Show codeHide code
---
/**
* Simple centered text brand: A centred heading over three figures split by dividers, on the brand colour.
*
* @block metrics
* @order 10
*/
import { 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 { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { MetricsContent } from '@/components/apogee/sections/_shared/metrics.ts'
/** @composable */
interface Props extends MetricsContent {}
const {
heading = 'Build something great',
description = 'Everything you need to build modern interfaces and great products.',
items = [
{ value: '400+', label: 'Projects completed' },
{ value: '600%', label: 'Return on investment' },
{ value: '10k', label: 'Global downloads' },
],
} = 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="mx-auto flex w-full max-w-3xl flex-col gap-8 md:flex-row md:gap-0 [&>*]:flex-1 md:[&>*+*]:border-s md:[&>*+*]:border-current/25">
{items.map((s) => (
<div class="flex flex-col gap-3 items-center text-center">
<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>
</div>
))}
</dl>
</div>
</Section>Add
npx @ava-ui/apogee add metrics/simple-centered-text-brand
This copies the block to src/components/apogee/blocks/metrics/ with everything it uses: FeaturedIcon, 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.