A heading, line and app download buttons beside a phone showing the app.

Last updated

Open block
Show code
---
/**
 * Phone mockup 01: A heading, line and app download buttons beside a phone showing the app.
 *
 * @block cta
 * @order 13
 */
import { Download, Smartphone } from '@lucide/astro'
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 DeviceFrame from '@/components/apogee/DeviceFrame/DeviceFrame.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 = 'Growth performance tracking made easy',
  description = 'Start your 30-day free trial today.',
  primaryAction = { label: 'Download for iOS', href: '#' },
  secondaryAction = { label: 'Get it on Android', href: '#' },
  media = { src: '/mockups/app-phone-light.jpg', srcDark: '/mockups/app-phone-dark.jpg', alt: 'The dashboard on a phone' },
} = Astro.props

---

<Section spacing="large">
  <div class="grid items-center gap-12 lg:grid-cols-2 lg:gap-16">
    <div class="flex flex-col gap-8">
      <SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} />
      {(primaryAction || secondaryAction) && (
      <div class="flex flex-wrap gap-3">
      {primaryAction && <Button href={primaryAction.href} size="large" variant="outline" color="neutral"><Smartphone slot="start" aria-hidden="true" />{primaryAction.label}</Button>}
      {secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral"><Download slot="start" aria-hidden="true" />{secondaryAction.label}</Button>}
    </div>
      )}
    </div>
    {media && (
    <div class="flex justify-center rounded-2xl bg-neutral-faded px-8 pt-12 lg:h-[34rem] lg:overflow-hidden">
      <DeviceFrame device="phone" src={media.src} srcDark={media.srcDark} alt={media.alt} width={media.width} height={media.height} class="max-w-64" />
    </div>
    )}
  </div>
</Section>

Add

npx @ava-ui/apogee add cta/iphone-mockup-01

This copies the block to src/components/apogee/blocks/cta/ with everything it uses: Button, DeviceFrame, 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.