A heading, line and two buttons beside a photo with one large rounded corner.

Last updated

Open block
Show code
---
/**
 * Split image 03: A heading, line and two buttons beside a photo with one large rounded corner.
 *
 * @block hero
 * @order 3
 */
import { CirclePlay } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import Heading from '@/components/apogee/Heading/Heading.astro'
import Button from '@/components/apogee/Button/Button.astro'
import Image from '@/components/apogee/Image/Image.astro'
import { plain, type HeroContent } from '@/components/apogee/sections/_shared/spine.ts'

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

const {
  heading = 'People who care about your growth',
  description = 'Powerful, self-serve product and growth analytics to help you convert, engage and retain more users. Trusted by over 4,000 startups.',
  primaryAction = { label: 'Sign up', href: '#' },
  secondaryAction = { label: 'Demo', href: '#' },
  media = { src: 'https://picsum.photos/seed/apogee-hero-3/1200/1400', alt: '', width: 1200, height: 1400 },
} = Astro.props
---

<Section spacing="large">
  <div class="grid items-center gap-12 lg:gap-16 lg:grid-cols-2">
    <div class="flex flex-col gap-8 md:gap-12">
      <div class="flex flex-col gap-4 md:gap-6 items-start">
      
      <Heading as="h1" size="display" class="text-balance">{plain(heading)}</Heading>
      {description && <p class="max-w-2xl text-lg md:text-xl text-neutral-faded">{description}</p>}
    </div>
      {(primaryAction || secondaryAction) && (
        <div class="flex flex-col-reverse gap-3 sm:flex-row ">
          {secondaryAction && <Button href={secondaryAction.href} size="large" variant="outline" color="neutral"><CirclePlay slot="start" aria-hidden="true" />{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" loading="eager" class="aspect-[6/7] w-full rounded-xl rounded-ss-[8rem]" />}
  </div>
</Section>

Add

npx @ava-ui/apogee add hero/split-image-03

This copies the block to src/components/apogee/blocks/hero/ with everything it uses: Button, Heading, Image, Section. 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 the page’s h1; the items below are one level down.
  • Photos that only decorate have an empty alt; give yours one when it carries meaning.