A section heading with a button over body text beside an image.

Last updated

Open block
Show code
---
/**
 * Section split image 01: A section heading with a button over body text beside an image.
 *
 * @block content
 * @order 13
 */
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Prose from '@/components/apogee/Prose/Prose.astro'
import Image from '@/components/apogee/Image/Image.astro'
import Button from '@/components/apogee/Button/Button.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { ContentContent } from '@/components/apogee/sections/_shared/content.ts'

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

const {
  eyebrow = "Why we're different",
  heading = 'We help teams ship work they are proud of',
  description = 'Shared parts, written rules and a strict build: less arguing about buttons, more time on the product.',
  primaryAction = { label: 'Get started', href: '#' },
  media = { src: 'https://picsum.photos/seed/apogee-content-40/1200/800', alt: '', width: 1200, height: 800 },
} = Astro.props
---

<Section spacing="large">
  <SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} class="mb-12">
    {primaryAction && <Button slot="actions" href={primaryAction.href} size="large">{primaryAction.label}</Button>}
  </SectionHeader>
  <div class="grid gap-12 lg:grid-cols-2 lg:gap-16">
    <Prose>
      <p>Most teams start a design system after the third button that looks almost, but not quite, like the other two. The cost is rarely the button; it is the conversation every time someone has to choose.</p>
      <p>A system turns those conversations into decisions made once, written down where people work, and checked by the build.</p>
    </Prose>
    {media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" radius="xl" class="aspect-[3/2] w-full" />}
  </div>
</Section>

Add

npx @ava-ui/apogee add content/section-split-image-01

This copies the block to src/components/apogee/blocks/content/ with everything it uses: Button, Image, Prose, 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.
  • Photos that only decorate have an empty alt; give yours one when it carries meaning.