current theme: placeholder

component :: Hero

The Hero component offers highly flexible, accessible hero sections for landing pages, product sites, and marketing. It supports full, split, and slideshow layouts; accepts image, video, gradient, or canvas backgrounds; provides overlay and text color controls; allows custom aspect ratios and content/media ordering; supports parallax, rounded corners, and a flush layout for the split variant; and is fully slot-based for custom content. (Full size demo.)

Example Hero

This hero uses an animated canvas element as background.

File NameclassSource
component.hero.css.heroGithub

Full layout (default)

The full layout spans the entire viewport with content centered over a background image, video, gradient, or canvas element. Use the height prop to control min-height (in svh units).

Split layout

The Split layout features an asymmetric split (e.g., 70/30, 80/20, etc.) with content on one side and media on the other. The media section fills the available space with an image or video, cropping as needed. The ratio prop defines the grid layout, contentFirst controls the DOM order of content and media, and reversed visually reverses their order (while the grid ratio remains unchanged).

Slideshow layout

The Slideshow layout features rotating content and background (same options available as for the Full layout) with pagination dots. Each slide can have its own media and content.

HTML

Custom properties

The following custom properties are available in the default theme:

PropertyDescription
--hero-radiusBorder radius (on/off via roundCorners prop).
--hero-content-paddingPadding for hero content area.
--hero-pagination-dotPagination dot size.
--hero-pagination-dot-colorPagination dot background color.
--hero-pagination-dot-active-colorActive pagination dot color.
--hero-pagination-opacityPagination dot default opacity.

Astro component

General props

PropTypeDefaultDescription
variantstringfullLayout variant: Full, Split, and Slideshow.
mediaobjectImage, video, gradient, or canvas background.
roundCornersbooleanfalseWhether the hero media has rounded corners.
textColorstringText color (CSS variable or value).
extraClassstringAdditional CSS classes (see helper classes).

Split variant props

PropTypeDefaultDescription
ratiostring62/38Split ratio, e.g. 70/30, 40/60, etc.
contentFirstbooleanfalseIf true, content appears before media in the DOM (left on desktop, top on mobile).
reversedbooleanfalseVisually reverses the order set by contentFirst (does not change DOM order).
roundCornersbooleanfalseIf true, media has rounded corners.
flushbooleanfalseRemoves outer padding from the content section, making text flush with the edge.

Full and slideshow variant props

PropTypeDefaultDescription
parallaxbooleanfalseParallax effect (full variant only).
heightnumberSets min-height in svh (0-100).
overlayOpacitynumber0Overlay opacity.
overlayColorstring--base-950Overlay color (CSS var or value).
roundCornersbooleanfalseIf true, hero has rounded corners.
textColorstringText color (CSS var or value).
slideshowItemsarrayArray of objects (see example).
slideshowAutoplaybooleantrueSlideshow autoplay.
slideshowIntervalnumber5000Slideshow interval (ms).
slideshowTransitionnumber600Slideshow transition speed (ms).

Examples