Form

Button

A button draws attention to an important action and initializes this action when clicked.
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => <Button>Hello World!</Button>;
4
export default Demo;

Props

NameTypeDefaultDescription
enabledrequiredboolean
"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.
aboutstring
accessKeystring
autoCapitalizestring
autoCorrectstring
autoFocusboolean
autoSavestring
childrenReactNode
classesstring | string[]
Additional CSS classes to set on the button element
classNamestring
colorstring
contentstring
contentEditableBooleanish | "inherit"
contextMenustring
dangerouslySetInnerHTML{ __html: string | TrustedHTML; }
datatypestring
defaultCheckedboolean
defaultValuestring | number | readonly string[]
dirstring
disabledboolean
draggableBooleanish
formstring
formActionstring
formEncTypestring
formMethodstring
formNoValidateboolean
formTargetstring
hiddenboolean
hideDisabledboolean
idstring
inlistany
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
isstring
Specify that a standard HTML element should behave like a defined custom built-in element
isLoadingboolean
If set to true, forces the button to display a spinner to the left of the text
itemIDstring
itemPropstring
itemRefstring
itemScopeboolean
itemTypestring
langstring
linkstring
namestring
noncestring
onAbortReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAbortCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationEndAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationEndCaptureAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationIterationAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationIterationCaptureAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationStartAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAnimationStartCaptureAnimationEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAuxClickMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onAuxClickCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onBeforeInputFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onBeforeInputCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onBlurFocusEventHandler<HTMLButtonElement | HTMLAnchorElement>
onBlurCaptureFocusEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCanPlayReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCanPlayCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCanPlayThroughReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCanPlayThroughCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onChangeFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onChangeCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onClick(() => void) & MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onClickCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionEndCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionEndCaptureCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionStartCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionStartCaptureCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionUpdateCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCompositionUpdateCaptureCompositionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onContextMenuMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onContextMenuCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCopyClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCopyCaptureClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCutClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onCutCaptureClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDoubleClickMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDoubleClickCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragEndDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragEndCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragEnterDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragEnterCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragExitDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragExitCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragLeaveDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragLeaveCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragOverDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragOverCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragStartDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDragStartCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDropDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDropCaptureDragEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDurationChangeReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onDurationChangeCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEmptiedReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEmptiedCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEncryptedReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEncryptedCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEndedReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onEndedCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onErrorReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onErrorCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onFocusFocusEventHandler<HTMLButtonElement | HTMLAnchorElement>
onFocusCaptureFocusEventHandler<HTMLButtonElement | HTMLAnchorElement>
onGotPointerCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onGotPointerCaptureCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onInputFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onInputCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onInvalidFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onInvalidCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onKeyDownKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onKeyDownCaptureKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onKeyUpKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onKeyUpCaptureKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadedDataReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadedDataCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadedMetadataReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadedMetadataCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadStartReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLoadStartCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLostPointerCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onLostPointerCaptureCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseDownMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseDownCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseEnterMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseLeaveMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseMoveMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseMoveCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseOutMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseOutCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseOverMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseOverCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseUpMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onMouseUpCaptureMouseEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPasteClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPasteCaptureClipboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPauseReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPauseCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPlayReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPlayCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPlayingReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPlayingCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerCancelPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerCancelCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerDownPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerDownCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerEnterPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerEnterCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerLeavePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerLeaveCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerMovePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerMoveCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerOutPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerOutCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerOverPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerOverCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerUpPointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onPointerUpCapturePointerEventHandler<HTMLButtonElement | HTMLAnchorElement>
onProgressReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onProgressCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onRateChangeReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onRateChangeCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onResetFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onResetCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onResizeReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onResizeCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onScrollUIEventHandler<HTMLButtonElement | HTMLAnchorElement>
onScrollCaptureUIEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSeekedReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSeekedCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSeekingReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSeekingCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSelectReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSelectCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onStalledReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onStalledCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSubmitFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSubmitCaptureFormEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSuspendReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onSuspendCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTimeUpdateReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTimeUpdateCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchCancelTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchCancelCaptureTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchEndTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchEndCaptureTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchMoveTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchMoveCaptureTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchStartTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTouchStartCaptureTouchEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTransitionEndTransitionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onTransitionEndCaptureTransitionEventHandler<HTMLButtonElement | HTMLAnchorElement>
onVolumeChangeReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onVolumeChangeCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onWaitingReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onWaitingCaptureReactEventHandler<HTMLButtonElement | HTMLAnchorElement>
onWheelWheelEventHandler<HTMLButtonElement | HTMLAnchorElement>
onWheelCaptureWheelEventHandler<HTMLButtonElement | HTMLAnchorElement>
placeholderstring
prefixstring
primaryboolean
propertystring
radioGroupstring
relstring
resourcestring
resultsnumber
revstring
roleAriaRole
securitystring
slotstring
smallboolean
If set to true, forces the button to have a smaller size
spellCheckBooleanish
styleCSSProperties
suppressContentEditableWarningboolean
suppressHydrationWarningboolean
tabIndexnumber
targetstring
titlestring
tooltipstring
tooltipPlacement"left" | "right" | "top" | "bottom"
translate"yes" | "no"
type"submit" | "reset" | "button"
typeofstring
unselectable"on" | "off"
valuestring | number | readonly string[]
vocabstring
"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"deprecatedBooleanish
in ARIA 1.1
Indicates an element's "grabbed" state in a drag-and-drop operation.
onKeyPressdeprecatedKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>
onKeyPressCapturedeprecatedKeyboardEventHandler<HTMLButtonElement | HTMLAnchorElement>

Examples

Primary, Default size
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => <Button primary>Hello World!</Button>;
4
export default Demo;
Secondary, Small size
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => <Button small>Hello World!</Button>;
4
export default Demo;
Disabled
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => (
4
<Button primary enabled={false}>
5
Hello World!
6
</Button>
7
);
8
export default Demo;
Loading
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => (
4
<>
5
<Button isLoading enabled={false}>
6
Disabled
7
</Button>
8
<Button isLoading primary enabled={false}>
9
Primary disabled
10
</Button>
11
</>
12
);
13
export default Demo;
Prepended icon
1
import {Button} from '@coveord/plasma-react';
2
3
const Demo = () => (
4
<Button classes={['mod-prepend']}>
5
<span className="btn-prepend">P</span>
6
Hello World!
7
</Button>
8
);
9
export default Demo;
Icon only with an hyperlink
1
import {Button} from '@coveord/plasma-react';
2
import {ZombieSize24Px} from '@coveord/plasma-react-icons';
3
4
const Demo = () => (
5
<Button link="https://www.coveo.com">
6
<ZombieSize24Px height={24} aria-label="zombie" />
7
</Button>
8
);
9
export default Demo;
With tooltip
1
import {Button, TooltipPlacement} from '@coveord/plasma-react';
2
3
const Demo = () => (
4
<Button primary tooltip="Hello there!" tooltipPlacement={TooltipPlacement.Top}>
5
Hover me!
6
</Button>
7
);
8
export default Demo;

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

TypePurpose
PrimaryA primary button draws the users' attention to the main action. There should be only one primary button per section or page.
SecondaryA secondary button triggers an action of lesser importance. Multiple secondary buttons may trigger actions of similar importance.
Icon + labelAdd a icon left of the label to clarify the action or draw attention to the button. Ensure the icon is highly recognizable.
Label + iconAdd 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 onlyWhen 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 separatorAdding 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.
Edit guidelines