Hero Sections
Present key information to your users
Use the Hero
component to build visually appealing hero sections that help capture your users attention. They create a strong first impression with bold visuals, typography, and call-to-actions. Use them to highlight key messages, product features, or promotions.
The above Hero
component was created with the following props:
title
: TheHero
component must have a title, set through thetitle
prop.subTitle
: Hero sections can also have an optional subtitle.buttons
: You can create CTA buttons by defining abuttons
prop that takes in an array of buttons. Each button object can have the props of aButton
component, along with atext
andicon
props that defines the text and icon of the button. Use theicon
property as the string to specify icons for Astro components, or import and pass an SVG string for Svelte/React components. For available icon types, see the documentation of theIcon
component.badge
: A badge can also be added above the title using thebadge
prop. Abadge
object can take the props of aBadge
component, along with thetext
prop that defines the text inside the badge.image
: Lastly, you can also define a featured image. Images must have asrc
,alt
,width
, andheight
attributes in order to be accessible.
Alternative Layout
The layout of hero sections can be modified using the reverse
prop to create an alternative layout:
New releases
Hero section title
Subtitle for hero section
API
Prop | Purpose |
---|---|
heading | Sets the h1 title for the hero section. |
subHeading | Sets the h2 title for the hero section. |
buttons | Sets CTAs under the titles. Pass an array of buttons using the props of the Button component. |
badge | Sets a badge above the titles. Pass an object using the props of the Badge component. |
image | Sets a featured image next to your titles and CTA. |
reverse | Switches the layout of the hero component. |
Request improvement for this page