Skip to content Button Button Button CSS Components Web Components
Button Button
Button
Buttons are clickable elements primarily used to perform an action, as they communicate the call-to-action and their style calls for users' attention. Buttons can also be used to allow navigation in some cases, such as for the “Next” or “Back” buttons that help users navigate through a form.
UX/UI Guidelines
Check the design documentation of the component in ZeroHeight.
Implementations
The component Button
is available in the following technologies:
Parameters
Parameters
Make sure you have read about the parameters in here.
The parametrization of the component can be done with the following custom params or properties:
Name | Type | Slot | Description |
---|---|---|---|
config | string | The main string chained parameter has three components following the pattern:
Where the components are:
| |
icon | string | The name of the icon that will be shown up inside the button. Check the icon list | |
content | string | ✅ | The text that will be shown up inside the button. |
icon-right | boolean | Defines the position of the icon. The default value is | |
disabled | boolean | Blocks the interaction with the component. | |
loading | boolean | Shows a loading animation inside the button. | |
wide | boolean string | Expands the button to the full width of its parent. | |
href | string | Transform the button into a link. | |
target | string | The target attribute specifies where to open the linked document. | |
popover-target | string | Refers to the popover element with the specified id, and toggle between showing and hiding it. Check the official docs | |
as-submit | boolean | Transform the button into a submit input. | |
custom | object | A record of key-value pairs to set the CSS custom tokens. It's a complex attribute set as an JS object in stringified JSON format. Example: html
Check the available values in the customization section. | |
custom-str | string | The stringified version of the Example: html
| |
z-theme | string | Sets the theme of the component. The possible values are html
|
From Figma to code
You can check the Figma implementation here.
Customization
INFO
Check everything about the customization mechanics in the "How it works" documentation.
CSS Variable | Type | Description |
---|---|---|
--z-button--bg | color | Background color |
--z-button--color | color | Foreground color |
--z-button--radius | distance | Radius of the button |
--z-button--backdrop | color | Popover's backdrop color |
--z-button--popover-radius | distance | Popover's radius |
--z-button--popover-padding | distance | Popover's padding |
Both, background and foreground color can be customized using the --z-button--bg
and --z-button--color
or the custom
attribute. You can use the --z-button--radius
token to change the border-radius of the button.
Accessibility
...