Hero
Hero
Component demo
Interactive example
Everything I brew, I brew it for you
<ic-heroheading="Everything I brew, I brew it for you"subheading="This news is hot off the French press."><ic-buttonvariant="primary"slot="interaction">Explore</ic-button><ic-buttonvariant="secondary"slot="interaction"> Check out our new drinks </ic-button></ic-hero>
Hero details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
|
|---|---|---|
|
|
The alignment of the hero. |
|
|
|
The optional background image. |
|
|
|
The alignment of the hero content. |
|
|
|
If |
|
|
|
The heading of the hero. An <h2> level heading. |
|
|
|
The optional secondary heading, an <h3> level heading. Replaced by slotted right content. |
|
|
|
The optional secondary subheading, replaced by slotted right content. |
|
|
|
The size of the hero component. |
|
|
|
The description for the hero. |
|
|
The alignment of the hero. |
|
The optional background image. |
|
The alignment of the hero content. |
|
If |
|
The heading of the hero. An <h2> level heading. |
|
The optional secondary heading, an <h3> level heading. Replaced by slotted right content. |
|
The optional secondary subheading, replaced by slotted right content. |
|
The size of the hero component. |
|
The description for the hero. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Variants
Centre aligned
Interactive example
Everything I brew, I brew it for you
<ic-heroheading="Everything I brew, I brew it for you"subheading="This news is hot off the French press."aligned="center"><ic-buttonvariant="primary"slot="interaction">Explore</ic-button><ic-buttonvariant="secondary"slot="interaction"> Check out our new drinks </ic-button></ic-hero>
Content centre aligned
Interactive example
Everything I brew, I brew it for you
<ic-heroheading="Everything I brew, I brew it for you"subheading="This news is hot off the French press."aligned="center"content-aligned="center"><ic-buttonvariant="primary"slot="interaction">Explore</ic-button><ic-buttonvariant="secondary"slot="interaction"> Check out our new drinks </ic-button></ic-hero>
Size small
Interactive example
New coffee launches 14 September 2022
<ic-heroheading="New coffee launches 14 September 2022"subheading="Brand new flavours now available! Irresistible. Caramel. Decadence. Sugary."size="small"><ic-buttonvariant="primary"slot="interaction"size="small">Order now</ic-button><ic-buttonvariant="secondary"slot="interaction"size="small">Submit new flavour</ic-button></ic-hero>
Secondary heading and search
Interactive example
Everything I brew, I brew it for you
The classics
<ic-heroheading="Everything I brew, I brew it for you"subheading="This news is hot off the French press."secondary-heading="The classics"secondary-subheading="Try our original flavours."><ic-search-barslot="interaction"label="Search for coffee"hide-label="true"></ic-search-bar></ic-hero>
Card right content
Interactive example
Everything I brew, I brew it for you
Out now