Phone mockup 04
A brand-colour card: a heading and download buttons beside a phone.
Last updated
---
/**
* Phone mockup 04: A brand-colour card: a heading and download buttons beside a phone.
*
* @block cta
* @order 16
*/
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 = 'Start your free trial',
description = 'Personal performance tracking made easy.',
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 overflow-hidden rounded-2xl bg-primary px-8 pt-12 text-on-primary md:px-16 lg:grid-cols-2 lg:pt-0">
<div class="flex flex-col gap-8 lg:py-16">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} background="primary" />
{(primaryAction || secondaryAction) && (
<div class="flex flex-wrap gap-3">
{primaryAction && <Button href={primaryAction.href} size="large" variant="outline" color="neutral" class="border-current! bg-transparent! text-inherit! shadow-none!"><Smartphone slot="start" aria-hidden="true" />{primaryAction.label}</Button>}
{secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral" class="border-current! bg-transparent! text-inherit! shadow-none!"><Download slot="start" aria-hidden="true" />{secondaryAction.label}</Button>}
</div>
)}
</div>
{media && (
<div class="flex h-80 justify-center lg:h-auto lg:self-stretch lg:pt-12">
<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>
Show codeHide code
---
/**
* Phone mockup 04: A brand-colour card: a heading and download buttons beside a phone.
*
* @block cta
* @order 16
*/
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 = 'Start your free trial',
description = 'Personal performance tracking made easy.',
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 overflow-hidden rounded-2xl bg-primary px-8 pt-12 text-on-primary md:px-16 lg:grid-cols-2 lg:pt-0">
<div class="flex flex-col gap-8 lg:py-16">
<SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} background="primary" />
{(primaryAction || secondaryAction) && (
<div class="flex flex-wrap gap-3">
{primaryAction && <Button href={primaryAction.href} size="large" variant="outline" color="neutral" class="border-current! bg-transparent! text-inherit! shadow-none!"><Smartphone slot="start" aria-hidden="true" />{primaryAction.label}</Button>}
{secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral" class="border-current! bg-transparent! text-inherit! shadow-none!"><Download slot="start" aria-hidden="true" />{secondaryAction.label}</Button>}
</div>
)}
</div>
{media && (
<div class="flex h-80 justify-center lg:h-auto lg:self-stretch lg:pt-12">
<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-04
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.