Phone mockup 02
A heading and download buttons beside a phone rising out of a tinted band.
Last updated
---
/**
* Phone mockup 02: A heading and download buttons beside a phone rising out of a tinted band.
*
* @block cta
* @order 14
*/
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-end gap-12 lg:grid-cols-2 lg:gap-16">
<div class="flex flex-col gap-8 lg:pb-16">
<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="relative flex justify-center pt-12">
<div class="absolute inset-x-0 bottom-0 h-3/4 rounded-2xl bg-neutral-faded" aria-hidden="true"></div>
<DeviceFrame device="phone" src={media.src} srcDark={media.srcDark} alt={media.alt} width={media.width} height={media.height} class="relative max-w-64" />
</div>
)}
</div>
</Section>
Show codeHide code
---
/**
* Phone mockup 02: A heading and download buttons beside a phone rising out of a tinted band.
*
* @block cta
* @order 14
*/
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-end gap-12 lg:grid-cols-2 lg:gap-16">
<div class="flex flex-col gap-8 lg:pb-16">
<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="relative flex justify-center pt-12">
<div class="absolute inset-x-0 bottom-0 h-3/4 rounded-2xl bg-neutral-faded" aria-hidden="true"></div>
<DeviceFrame device="phone" src={media.src} srcDark={media.srcDark} alt={media.alt} width={media.width} height={media.height} class="relative max-w-64" />
</div>
)}
</div>
</Section>Add
npx @ava-ui/apogee add cta/iphone-mockup-02
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
h2by default, so the block slots into a page under itsh1; item titles are one level down.
Related
DeviceFrameA screenshot in a phone, a landscape tablet or a browser window, drawn in CSS with the theme's colours; it scales as a whole and a dark screenshot swaps in with the theme.
ButtonTriggers an action. Renders a <button>, or an <a> when href is set. Hue, fill and height are three separate props.
CarouselA horizontal scroll-snap track for browsing slides. Native scroll and swipe work with zero JS; arrows, dots, and autoplay are progressive enhancement.