Button
Props
Name | Type | Default | Description |
---|---|---|---|
enabled required | boolean | ||
"aria-activedescendant" | string | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. | |
"aria-atomic" | Booleanish | Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. | |
"aria-autocomplete" | "list" | "none" | "inline" | "both" | Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
presented if they are made. | |
"aria-braillelabel" | string | Defines a string value that labels the current element, which is intended to be converted into Braille. | |
"aria-brailleroledescription" | string | Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille. | |
"aria-busy" | Booleanish | ||
"aria-checked" | boolean | "true" | "false" | "mixed" | Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. | |
"aria-colcount" | number | Defines the total number of columns in a table, grid, or treegrid. | |
"aria-colindex" | number | Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. | |
"aria-colindextext" | string | Defines a human readable text alternative of aria-colindex. | |
"aria-colspan" | number | Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. | |
"aria-controls" | string | Identifies the element (or elements) whose contents or presence are controlled by the current element. | |
"aria-current" | boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | Indicates the element that represents the current item within a container or set of related elements. | |
"aria-describedby" | string | Identifies the element (or elements) that describes the object. | |
"aria-description" | string | Defines a string value that describes or annotates the current element. | |
"aria-details" | string | Identifies the element that provides a detailed, extended description for the object. | |
"aria-disabled" | Booleanish | Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. | |
"aria-errormessage" | string | Identifies the element that provides an error message for the object. | |
"aria-expanded" | Booleanish | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. | |
"aria-flowto" | string | Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
allows assistive technology to override the general default of reading in document source order. | |
"aria-haspopup" | boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. | |
"aria-hidden" | Booleanish | Indicates whether the element is exposed to an accessibility API. | |
"aria-invalid" | boolean | "true" | "false" | "grammar" | "spelling" | Indicates the entered value does not conform to the format expected by the application. | |
"aria-keyshortcuts" | string | Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. | |
"aria-label" | string | Defines a string value that labels the current element. | |
"aria-labelledby" | string | Identifies the element (or elements) that labels the current element. | |
"aria-level" | number | Defines the hierarchical level of an element within a structure. | |
"aria-live" | "off" | "assertive" | "polite" | Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. | |
"aria-modal" | Booleanish | Indicates whether an element is modal when displayed. | |
"aria-multiline" | Booleanish | Indicates whether a text box accepts multiple lines of input or only a single line. | |
"aria-multiselectable" | Booleanish | Indicates that the user may select more than one item from the current selectable descendants. | |
"aria-orientation" | "horizontal" | "vertical" | Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. | |
"aria-owns" | string | Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
between DOM elements where the DOM hierarchy cannot be used to represent the relationship. | |
"aria-placeholder" | string | Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
A hint could be a sample value or a brief description of the expected format. | |
"aria-posinset" | number | Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. | |
"aria-pressed" | boolean | "true" | "false" | "mixed" | Indicates the current "pressed" state of toggle buttons. | |
"aria-readonly" | Booleanish | Indicates that the element is not editable, but is otherwise operable. | |
"aria-relevant" | "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. | |
"aria-required" | Booleanish | Indicates that user input is required on the element before a form may be submitted. | |
"aria-roledescription" | string | Defines a human-readable, author-localized description for the role of an element. | |
"aria-rowcount" | number | Defines the total number of rows in a table, grid, or treegrid. | |
"aria-rowindex" | number | Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. | |
"aria-rowindextext" | string | Defines a human readable text alternative of aria-rowindex. | |
"aria-rowspan" | number | Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. | |
"aria-selected" | Booleanish | Indicates the current "selected" state of various widgets. | |
"aria-setsize" | number | Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. | |
"aria-sort" | "none" | "ascending" | "descending" | "other" | Indicates if items in a table or grid are sorted in ascending or descending order. | |
"aria-valuemax" | number | Defines the maximum allowed value for a range widget. | |
"aria-valuemin" | number | Defines the minimum allowed value for a range widget. | |
"aria-valuenow" | number | Defines the current value for a range widget. | |
"aria-valuetext" | string | Defines the human readable text alternative of aria-valuenow for a range widget. | |
about | string | ||
accessKey | string | ||
autoCapitalize | string | ||
autoCorrect | string | ||
autoFocus | boolean | ||
autoSave | string | ||
children | ReactNode | ||
classes | string | string[] | Additional CSS classes to set on the button element | |
className | string | ||
color | string | ||
content | string | ||
contentEditable | Booleanish | "inherit" | ||
contextMenu | string | ||
dangerouslySetInnerHTML | { __html: string | TrustedHTML; } | ||
datatype | string | ||
defaultChecked | boolean | ||
defaultValue | string | number | readonly string[] | ||
dir | string | ||
disabled | boolean | ||
draggable | Booleanish | ||
form | string | ||
formAction | string | ||
formEncType | string | ||
formMethod | string | ||
formNoValidate | boolean | ||
formTarget | string | ||
hidden | boolean | ||
hideDisabled | boolean | ||
id | string | ||
inlist | any | ||
inputMode | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | Hints at the type of data that might be entered by the user while editing the element or its contents | |
is | string | Specify that a standard HTML element should behave like a defined custom built-in element | |
isLoading | boolean | If set to true, forces the button to display a spinner to the left of the text | |
itemID | string | ||
itemProp | string | ||
itemRef | string | ||
itemScope | boolean | ||
itemType | string | ||
lang | string | ||
link | string | ||
name | string | ||
nonce | string | ||
onAbort | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAbortCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationEnd | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationEndCapture | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationIteration | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationIterationCapture | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationStart | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAnimationStartCapture | AnimationEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAuxClick | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onAuxClickCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onBeforeInput | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onBeforeInputCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onBlur | FocusEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onBlurCapture | FocusEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCanPlay | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCanPlayCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCanPlayThrough | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCanPlayThroughCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onChange | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onChangeCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onClick | (() => void) & MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onClickCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionEnd | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionEndCapture | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionStart | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionStartCapture | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionUpdate | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCompositionUpdateCapture | CompositionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onContextMenu | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onContextMenuCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCopy | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCopyCapture | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCut | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onCutCapture | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDoubleClick | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDoubleClickCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDrag | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragEnd | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragEndCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragEnter | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragEnterCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragExit | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragExitCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragLeave | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragLeaveCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragOver | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragOverCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragStart | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDragStartCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDrop | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDropCapture | DragEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDurationChange | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onDurationChangeCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEmptied | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEmptiedCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEncrypted | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEncryptedCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEnded | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onEndedCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onError | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onErrorCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onFocus | FocusEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onFocusCapture | FocusEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onGotPointerCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onGotPointerCaptureCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onInput | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onInputCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onInvalid | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onInvalidCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onKeyDown | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onKeyDownCapture | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onKeyUp | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onKeyUpCapture | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoad | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadedData | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadedDataCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadedMetadata | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadedMetadataCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadStart | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLoadStartCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLostPointerCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onLostPointerCaptureCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseDown | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseDownCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseEnter | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseLeave | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseMove | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseMoveCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseOut | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseOutCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseOver | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseOverCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseUp | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onMouseUpCapture | MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPaste | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPasteCapture | ClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPause | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPauseCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPlay | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPlayCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPlaying | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPlayingCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerCancel | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerCancelCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerDown | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerDownCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerEnter | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerEnterCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerLeave | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerLeaveCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerMove | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerMoveCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerOut | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerOutCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerOver | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerOverCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerUp | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onPointerUpCapture | PointerEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onProgress | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onProgressCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onRateChange | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onRateChangeCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onReset | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onResetCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onResize | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onResizeCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onScroll | UIEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onScrollCapture | UIEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSeeked | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSeekedCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSeeking | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSeekingCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSelect | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSelectCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onStalled | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onStalledCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSubmit | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSubmitCapture | FormEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSuspend | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onSuspendCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTimeUpdate | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTimeUpdateCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchCancel | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchCancelCapture | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchEnd | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchEndCapture | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchMove | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchMoveCapture | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchStart | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTouchStartCapture | TouchEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTransitionEnd | TransitionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onTransitionEndCapture | TransitionEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onVolumeChange | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onVolumeChangeCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onWaiting | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onWaitingCapture | ReactEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onWheel | WheelEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onWheelCapture | WheelEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
placeholder | string | ||
prefix | string | ||
primary | boolean | ||
property | string | ||
radioGroup | string | ||
rel | string | ||
resource | string | ||
results | number | ||
rev | string | ||
role | AriaRole | ||
security | string | ||
slot | string | ||
small | boolean | If set to true, forces the button to have a smaller size | |
spellCheck | Booleanish | ||
style | CSSProperties | ||
suppressContentEditableWarning | boolean | ||
suppressHydrationWarning | boolean | ||
tabIndex | number | ||
target | string | ||
title | string | ||
tooltip | string | ||
tooltipPlacement | "left" | "right" | "top" | "bottom" | ||
translate | "yes" | "no" | ||
type | "submit" | "reset" | "button" | ||
typeof | string | ||
unselectable | "on" | "off" | ||
value | string | number | readonly string[] | ||
vocab | string | ||
"aria-dropeffect" deprecated | "link" | "none" | "copy" | "execute" | "move" | "popup" | in ARIA 1.1 Indicates what functions can be performed when a dragged object is released on the drop target. | |
"aria-grabbed" deprecated | Booleanish | in ARIA 1.1 Indicates an element's "grabbed" state in a drag-and-drop operation. | |
onKeyPress deprecated | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> | ||
onKeyPressCapture deprecated | KeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement> |
Examples
Primary, Default size
Secondary, Small size
Disabled
Loading
Prepended icon
Icon only with an hyperlink
With tooltip
Best Practices
The button label should allow users to foresee what will happen when clicking them.
Avoid multiplying buttons within a page. A page should have only one primary action button. If several secondary action buttons are required, consider using actionable items instead.
Labeling
Keep labels short, preferably under three words. Use trigger words to clearly indicate the action performed by the button. A trigger word is typically a verb that influences users into clicking due to its specificity. For example, use "View profile" rather than "Open profile", and "Create playlist" rather than "Save".
The first word of the label should be a verb. If adding a noun is required for context, avoid including an article. For example, write "Add filter" rather than "Add a filter", but write "Save" and "Cancel".
When using a button to have users confirm the action to execute, use an active word to clearly state the resulting action. For instance, if users must confirm the deletion of a file, write "Delete" and "Cancel" rather than "Yes" and "No".
Order of Buttons
When using a group of related buttons, such as for the "Save" and "Cancel" actions, always put the primary button to the right and the secondary to the left of the primary button.
In such case, the primary button must correspond to an action that moves the user forward through their journey or to the main action that the user should take.
For example, in the Sticky footer of a page where the user edits a configuration, order buttons as follows: "Cancel" (secondary), then "Save" (primary).
Similarly, in the footer of a modal wizard, navigation buttons must be ordered as follows: "Previous" (secondary), then "Next" (primary). At the last step, the “Next” button must be replaced with a primary button with a label indicating the resulting action. For example, an appropriate label would be “Add filter” rather than “Save”.
In a page header, the primary button should appear on the left and the secondary button should be to the right of the primary button. The primary action usually relates to the creation of new elements, while secondary actions are usually used to trigger troubleshooting or management actions, such as activity review. If multiple secondary actions are required, group them using an actionable item on the rightmost side of the header.
Variants
Type | Purpose |
---|---|
Primary | A primary button draws the users' attention to the main action. There should be only one primary button per section or page. |
Secondary | A secondary button triggers an action of lesser importance. Multiple secondary buttons may trigger actions of similar importance. |
Icon + label | Add a icon left of the label to clarify the action or draw attention to the button. Ensure the icon is highly recognizable. |
Label + icon | Add an icon right of the label to indicate that additional options are available when clicking the button. This indicates that clicking the button doesn't immediately trigger the action. Instead, a menu overlay is displayed, allowing users to select the exact action to be performed. For example, use a label and an icon on the right when the action is "Create" and options are to create from a template or a blank file. |
Icon only | When space is an issue or when the icon is highly and instantly recognizable, an icon alone may suffice. For instance, the "Settings" button is commonly presented using a cog icon. However, you should never use an icon-only button for primary actions. |
Append and prepend separator | Adding a separator is an aesthetic choice typically made when multiple buttons are stacked vertically. Use a separator to align the icon to the right or left of the button. All buttons must have the same width when vertically stacked. |
Feedback and Validation
When the label is hidden, add a tooltip displaying the action.
Related Components
If your use case doesn't match the guidelines above, consider using one of the following components instead:
- Link - When you need to redirect users to another section or website.
- Actionable items - When you need to group several less important actions together.