Hero
Full-width hero blocks for prominent page-level messaging with text and media layouts.
Text hero
Section titled “Text hero”The text hero is a full-height block with the title at the top and body + actions pushed to the bottom. The vertical gap between title and body is flexible. It grows with the element’s height.
Show code
<section class="text-hero" style="min-height: 740px"> <h1 slot="title">Care. By Volvo</h1> <div slot="body"> <p>All-electric Volvo EX60</p> <p> A transparent monthly cost that includes service and financing. Now with free home charging. </p> </div> <div slot="action" class="button-group"> <a class="button-filled" href="#">Choose your EX60</a> <a class="button-filled" data-color="subtle" href="#">Read more</a> </div></section>This component uses slots to give content built-in styling.
slot="title"- Primary headingslot="body"- Supporting textslot="action"- Buttons or links
The body slot has a max-width of var(--v-size-contentmax) (70ch by default) at every breakpoint.
Show code
<section class="text-hero" style="min-height: 600px"> <code slot="title">title</code> <code slot="body">body</code> <code slot="action">action</code></section>Height
Section titled “Height”The text hero requires explicit height to create the flexible gap between the title and body+action. Without height, the body collapses directly below the title.
The recommended minimum height is 80vh.
Set height via:
- Inline style:
min-height: 80vh - Utility class:
min-h-full(inside a sized parent) - Layout context: when placed in a grid or flex container that assigns height
Media hero
Section titled “Media hero”The media hero presents a heading, body text, and action buttons above a full-width media element. On mobile the content stacks vertically; on large screens the heading occupies the left half while body and actions sit on the right.
Use a semantic <section> element (or <div>) as the root.
Show code
<section class="media-hero"> <h1 slot="title">Care. By Volvo</h1> <div slot="body"> <p> All-electric Volvo EX60 A transparent monthly cost that includes service and financing. Now with free home charging. </p> </div> <div slot="action" class="button-group"> <a class="button-filled" href="#">Choose your EX60</a> <a class="button-filled" data-color="subtle" href="#">Read more</a> </div> <img slot="media" src="/images/decorative/ex60-road.avif" alt="" /></section>This component uses slots to give content built-in styling.
slot="title"- Primary headingslot="body"- Optional supporting textslot="action"- Optional buttons or linksslot="media"- Image or video
The body slot has a max-width of var(--v-size-contentmax) (70ch by default) at every breakpoint.
Show code
<section class="media-hero"> <code slot="title">title</code> <code slot="body">body</code> <code slot="action">action</code> <div slot="media" class="bg-feedback-gray flex items-center justify-center"> <code>media</code> </div></section>Place all slots directly inside .media-hero, without a wrapper. Keep title, body, and action in that order, omitting any optional slots you don’t need.
Media order
Section titled “Media order”The supported placement for media is on top, in between title and body or at the bottom.
Show code
<section class="media-hero"> <h1 slot="title">Care. By Volvo</h1> <img slot="media" src="/images/decorative/ex60-road.avif" alt="" /> <div slot="body"> <p> All-electric Volvo EX60 A transparent monthly cost that includes service and financing. Now with free home charging. </p> </div> <div slot="action" class="button-group"> <a class="button-filled" href="#">Choose your EX60</a> <a class="button-filled" data-color="subtle" href="#">Read more</a> </div></section>Optional slots
Section titled “Optional slots”body and action are optional. When you omit body, action wraps below the title. When you omit action, the title placement stays the same.
Show code
<section class="media-hero"> <h1 slot="title">Care. By Volvo</h1> <div slot="action" class="button-group"> <a class="button-filled" href="#">Choose your EX60</a> <a class="button-filled" data-color="subtle" href="#">Read more</a> </div> <img slot="media" src="/images/decorative/ex60-road.avif" alt="" /></section>Aspect ratio
Section titled “Aspect ratio”The media slot includes responsive default aspect ratios that adapt across breakpoints:
| Breakpoint | Aspect ratio | Token |
|---|---|---|
| sm | 1:1 | Square, mobile-optimized |
| md | 3:2 | Landscape, tablet |
| lg, xl | 21:9 | Desktop |
These defaults can be overridden with aspect ratio utility classes on the media element:
<!-- Override to use 16:9 on all breakpoints --><img slot="media" class="aspect-16/9" src="…" alt="" />
<!-- Override only on desktop --><img slot="media" class="lg:aspect-16/9" src="…" alt="" />Accessibility
Section titled “Accessibility”- Use semantic elements:
<section>for page sections,<div>when no semantic meaning is needed - Choose the appropriate heading level (
<h1>,<h2>) based on the page hierarchy - Ensure action links and buttons have meaningful text describing their destination or purpose
CSS reference
Section titled “CSS reference”| Class | Description |
|---|---|
text-hero |
Root class. Flex column with title at top, body+action pushed to bottom via auto margin. |
media-hero |
Root class. Media first or last, or no media, uses two text columns at lg and xl when the body slot is present, with or without actions; media middle stays in one column. |
button-group |
Layout class for the action slot. Provides responsive side-by-side button layout. |