Button
Button
Component demo
Interactive example
Button details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
If |
|
|
If |
|
|
If |
|
|
If |
|
|
If |
|
|
If |
|
|
The name of the control for the file input, which is submitted with the form data. |
|
|
If |
|
|
The <form> element to associate the button with. |
|
|
The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner. |
|
|
The way the submitted form data is encoded. |
|
|
The HTTP method used to submit the form. |
|
|
If |
|
|
The place to display the response from submitting the form. It overrides the target attribute of the button's form owner. |
|
|
If |
|
|
The URL that the link points to. This will render the button as an "a" tag. |
|
|
The human language of the linked URL. |
|
|
If |
|
|
If |
|
|
If |
|
|
How much of the referrer to send when following the link. |
|
|
The relationship of the linked URL as space-separated link types. |
|
|
The list of the files that have been selected by a user. |
|
|
The size of the button to be displayed. |
|
|
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
|
|
Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. |
|
|
The position of the tooltip in relation to the button. |
|
|
If |
|
|
The type of the button. |
|
|
The variant of the button to be displayed. |
|
If |
If |
If |
If |
If |
If |
The name of the control for the file input, which is submitted with the form data. |
If |
The <form> element to associate the button with. |
The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner. |
The way the submitted form data is encoded. |
The HTTP method used to submit the form. |
If |
The place to display the response from submitting the form. It overrides the target attribute of the button's form owner. |
If |
The URL that the link points to. This will render the button as an "a" tag. |
The human language of the linked URL. |
If |
If |
If |
How much of the referrer to send when following the link. |
The relationship of the linked URL as space-separated link types. |
The list of the files that have been selected by a user. |
The size of the button to be displayed. |
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. |
The position of the tooltip in relation to the button. |
If |
The type of the button. |
The variant of the button to be displayed. |
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.
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CSS Custom Properties
|
|
---|---|
|
|
|
|
|
|
Events
All components also accept native events supported by the DOM, such as
onClick
and
onKeyDown
.
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
|
|
|
---|---|---|
|
|
|
|
Variants
Other states
Interactive example
With icon
Interactive example
Icon Button
When using an icon button, refer to the guidance of using
aria-label
ortitle
to provide context to screen readers.