Skip to content

HeroLayout ​

Landing page for product launches and signups: a hero (eyebrow, title, description, calls to action, media), followed by the page sections. The title has a fluid size that follows the container width.

Usage ​

Centered hero ​

vue
<template>
  <SuHeroLayout>
    <template #eyebrow>
      <SuBadge variant="secondary">New · version 3</SuBadge>
    </template>
    <template #title>Ship your product faster</template>
    <template #description>
      <p>A clear pitch, a single call to action and a visual.</p>
    </template>
    <template #actions>
      <SuButton variant="primary">Get started</SuButton>
      <SuButton variant="outline">Watch the demo</SuButton>
    </template>
    <template #media>
      <img src="/screenshot.png" alt="Product dashboard" width="1200" height="720" />
    </template>

    <FeaturesSection />
    <PricingSection />
  </SuHeroLayout>
</template>

Media beside the text ​

With media-position="end", the media moves next to the text from 1024px and the text aligns left.

vue
<SuHeroLayout media-position="end" align="start">…</SuHeroLayout>

Full height ​

full-height gives the hero at least the screen height, with content vertically centered.

vue
<SuHeroLayout full-height>…</SuHeroLayout>

API ​

Props ​

PropTypeDefaultDescription
align'center' | 'start''center'Hero text alignment
mediaPosition'bottom' | 'end''bottom'Media below the text, or beside it from 1024px
fullHeightbooleanfalseThe hero takes at least the screen height
titleTag'h1' | 'h2' | 'h3''h1'Title heading level
gap'none' | 'sm' | 'md' | 'lg' | 'xl''xl'Gap between the hero and the sections

Slots ​

SlotDescription
eyebrowSmall text above the title: badge, category, announcement
titleHero title, rendered in titleTag
descriptionSubtitle or pitch
actionsCall-to-action buttons
mediaImage, screenshot, video (media are made fluid)
defaultSections following the hero

Responsive behavior ​

Container widthRendering
< 1024pxText then media, stacked
≥ 1024pxWith media-position="end": text | media

The title grows from 32px to 60px with the container width (clamp() in container units), with no breakpoint.

Accessibility ​

  • Named region: the hero is a <section> named by its title (aria-labelledby).
  • Heading level: h1 by default, since the hero opens the page. Use title-tag="h2" when the page already has an h1.
  • Calls to action: a single primary button (variant="primary") keeps the journey clear; navigation links remain <a> (SuLink), not buttons.

Publié sous licence MIT.