A heading, body text and two buttons beside an abstract image.

Last updated

Open block
Show code
---
/**
 * Section split image 03: A heading, body text and two buttons beside an abstract image.
 *
 * @block content
 * @order 15
 */
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.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 = 'Our studio',
  heading = 'People first. Design later.',
  description = 'We are a small studio that builds design systems with the teams who will use them.',
  primaryAction = { label: 'Get in touch', href: '#' },
  secondaryAction = { label: 'Our process', href: '#' },
  media = { src: 'https://picsum.photos/seed/apogee-content-44/1200/1000', alt: '', width: 1200, height: 1000 },
} = 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-col-reverse gap-3 sm:flex-row">
        {secondaryAction && <Button href={secondaryAction.href} variant="outline" color="neutral" size="large">{secondaryAction.label}</Button>}
        {primaryAction && <Button href={primaryAction.href} size="large">{primaryAction.label}</Button>}
      </div>
      )}
    </div>
    {media && <Image src={media.src} alt={media.alt} width={media.width} height={media.height} fit="cover" radius="xl" class="aspect-[6/5] w-full" />}
  </div>
</Section>

Add

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

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