A heading and line with two buttons beside them from lg.

Last updated

Open block
Show code
---
/**
 * Simple left: A heading and line with two buttons beside them from lg.
 *
 * @block cta
 * @order 2
 */
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Button from '@/components/apogee/Button/Button.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { CTAContent } from '@/components/apogee/sections/_shared/cta.ts'

/** @composable */
interface Props extends CTAContent {}

const {
  eyebrow,
  heading = 'Start your free trial',
  description = 'Join over 4,000+ startups already growing with us.',
  primaryAction = { label: 'Get started', href: '#' },
  secondaryAction = { label: 'Learn more', href: '#' },
} = Astro.props

---

<Section spacing="large">
  <div class="flex flex-col gap-8 lg:flex-row lg:items-center lg:justify-between">
    <SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} />
    {(primaryAction || secondaryAction) && (
    <div class="flex flex-col-reverse gap-3 sm:flex-row shrink-0">
      {secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral">{secondaryAction.label}</Button>}
      {primaryAction && <Button href={primaryAction.href} size="large">{primaryAction.label}</Button>}
    </div>
    )}
  </div>
</Section>

Add

npx @ava-ui/apogee add cta/simple-left

This copies the block to src/components/apogee/blocks/cta/ with everything it uses: Button, 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 h2 by default, so the block slots into a page under its h1; item titles are one level down.