Skip to main content

Hero

Ant Design

The Hero component is a large header at the top of a page, with a title, a short summary, up to two buttons and an optional key figure, such as a welcome banner on a dashboard.

Properties​

Property
Description
Expected Value
EyebrowSmall text shown above the title, such as a section name.Text
TitleMain heading.Text. Default: Good morning
Sub titleText shown under the title.Text. Default: Here is what changed since yesterday.
MetaSmall text shown under the sub title, such as a date or owner. A list of {label, value} shows as Label: value items.Text
Action labelText of the main button. Leave it empty for no button.Text
Secondary action labelText of a second, outlined button. Leave it empty for no button.Text
Aside valueA key figure shown large at the right, such as 128 or $42K. Leave it empty to hide it.Text
Aside labelCaption shown above Aside value.Text
IconAn icon shown above the text, by its Ant Design name, such as RocketOutlined, or a plain word, such as rocket.Text
BackgroundLook of the header. plain has no fill, tint is a light wash of the theme color, gradient fades that wash into the page background, dark is dark navy and solid is the theme color, both with light text, and image shows Image URL behind a dark overlay.plain, tint, gradient, image, dark, solid. Default: tint
Image URLURL of the background image, used when Background is image.Text
AlignWhether the text and buttons line up at the left or in the center.left, center. Default: left
SizeSize of the title and the space around it.compact, default, large. Default: default

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On action clickedTriggers when the user clicks the main button.
On secondary action clickedTriggers when the user clicks the second button.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set visibilityShows the component when true, hides it when false.components.hero1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.hero1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.hero1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
eyebrowSmall text shown above the title, such as a section name.{{components.hero1.eyebrow}}
titleMain heading.{{components.hero1.title}}
subTitleText shown under the title.{{components.hero1.subTitle}}
metaSmall text shown under the sub title, such as a date or owner. A list of {label, value} shows as Label: value items.{{components.hero1.meta}}
actionLabelText of the main button. Leave it empty for no button.{{components.hero1.actionLabel}}
secondaryActionLabelText of a second, outlined button. Leave it empty for no button.{{components.hero1.secondaryActionLabel}}
asideValueA key figure shown large at the right, such as 128 or $42K. Leave it empty to hide it.{{components.hero1.asideValue}}
asideLabelCaption shown above Aside value.{{components.hero1.asideLabel}}
iconAn icon shown above the text, by its Ant Design name, such as RocketOutlined, or a plain word, such as rocket.{{components.hero1.icon}}
backgroundLook of the header. plain has no fill, tint is a light wash of the theme color, gradient fades that wash into the page background, dark is dark navy and solid is the theme color, both with light text, and image shows Image URL behind a dark overlay.{{components.hero1.background}}
imageUrlURL of the background image, used when Background is image.{{components.hero1.imageUrl}}
alignWhether the text and buttons line up at the left or in the center.{{components.hero1.align}}
sizeSize of the title and the space around it.{{components.hero1.size}}
isVisibleWhether the component is visible.{{components.hero1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.hero1.isLoading}}
isDisabledWhether the component is disabled.{{components.hero1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.