Button
Button component is used to trigger an action or event.
Sizes
Icon
Use the startIcon
or endIcon
props to insert an icon on the button.
You can also use the icon
prop and pass icon directly to children
of the HvButton
component.
When using icon-only buttons (icon
prop), it’s preferable to use the HvIconButton
component instead,
as it wraps the button in an HvTooltip
component and requires a title
label.
Custom root component
You can use the component
prop to change the root component of the button to be other than button
whether it’s a native HTML element or your own custom React component.
Semantic buttons
If you need a button that exists on a semantic container you can set the variant
prop to semantic
.
Focusable when disabled
If you still need the button to be focusable when disabled for accessibility purposes, you can set the focusableWhenDisabled
property to true
.
When using this property, the buttons will continue to be read by screen readers when disabled.