A centred heading, line and a billing switch.

Last updated

Open block
Show code
---
/**
 * Centered tabs: A centred heading, line and a billing switch.
 *
 * @block header
 * @order 9
 */
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import SegmentedControl from '@/components/apogee/SegmentedControl/SegmentedControl.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PageHeaderContent } from '@/components/apogee/sections/_shared/header.ts'

/** @composable */
interface Props extends PageHeaderContent {}
const { eyebrow = 'Pricing', heading = 'Simple, transparent pricing', description = 'Simple, transparent pricing that grows with you. Try any plan free for 30 days.' } = Astro.props
---

<Section spacing="large">
  <div class="flex flex-col gap-8 md:gap-12 items-stretch sm:items-center">
    <SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} headingLevel={1} size="large" align="center" />
    <SegmentedControl name="billing" options={[{ label: 'Monthly billing', value: 'monthly' }, { label: 'Annual billing', value: 'annual' }]} value="monthly" aria-label="Billing period" size="large" />
  </div>
</Section>

Add

npx @ava-ui/apogee add header/centered-tabs

This copies the block to src/components/apogee/blocks/header/ with everything it uses: Section, SectionHeader, SegmentedControl. 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.