Rost
← All components
pattern

Hero Media

A full-width hero: artwork pinned behind a 16px frame and dimmed, with the content on top.

In codeContract: reviewGuidance: agreedContract on GitHubFigma 793:2345
hero-media

When to use

  • Used at the top of a page that opens with artwork, like a project or an article. One per page.

When not to use

  • A page that opens with words, not an image. The Paper effect suits that one better.

Behaviour

The artwork stays put and the page scrolls over it (background-attachment: fixed). Phones, tablets and prefers-reduced-motion get a normal static background instead. The dim only works as opacity and the colour underneath together. Never change one without the other.

Accessibility

  • Artwork: it's a background image, so it's decoration by definition. Anything people need from it goes in the text.
  • Contrast: check the text against the dimmed artwork, not the colour underneath.
  • Motion: the pinned effect switches off with prefers-reduced-motion.

Props

PropTypeValuesDefault
mediaslot
contentslot

Where it's used

Where code differs on purpose

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

PartPropertyValueToken
rootdisplayblocklayout
rootpositionrelativelayout
rootheight630pxspacing/layout/hero-height
rootpadding16pxspacing/gap/medium
rootbackground#060805non-interactive/background/primary
framepositionrelativelayout
frameheight100%layout
frameoverflowhiddenlayout
frameclip-pathinset(0 round var(--spacing-radius-xlarge))Figma frame size
frameborder-radius24pxspacing/radius/xlarge
framebackground#171717non-interactive/background/secondary
mediapositionabsolutelayout
mediainset0layout
mediapointer-eventsnoneFigma frame size
mediaopacity0.48opacity/medium
contentpositionrelativelayout
contentheight100%layout