Skip to main contentCarbon Design System

Button

Color

Primary button

ClassPropertyColor token
.bx--btn--primarytext color$text-04
.bx--btn__iconsvg$icon-03
.bx--btn--primarybackground-color$interactive-01
:hoverbackground-color$hover-primary
:activebackground-color$active-primary
:focusborder$focus
:focusinset$ui-background
:disabledbackground-color$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-03
Primary button states and color

Secondary button

ClassPropertyColor token
.bx--btn--secondarytext color$text-04
.bx--btn__iconsvg$icon-03
.bx--btn--secondarybackground-color$interactive-02
.bx--btn--secondaryborder$interactive-02
:hoverbackground-color$hover-secondary
:activebackground-color$active-secondary
:focusborder$focus
:focusinset$ui-background
:disabledbackground-color$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-03
Secondary button states and color

Tertiary button

ClassPropertyColor token
.bx--btn--tertiarytext color$interactive-03
.bx--btn__iconsvg$interactive-03
.bx--btn--tertiarybackground-colortransparent
.bx--btn--tertiaryborder$interactive-03
:hovertext color$inverse-01
:hoversvg$icon-03
:hoverbackground-color$hover-tertiary
:activebackground-color$active-tertiary
:focusbackground-color$interactive-03
:focusborder$focus
:focusinset$ui-background
:disabledbackgroundtransparent
:disabledborder$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-02
Tertiary button states and color

Ghost button

ClassPropertyColor token
.bx--btn--ghosttext color$link-01
.bx--btn__iconsvg$link-01
.bx--btn--ghostbackground-color–
:hovertext color$hover-primary-text
:hoversvg$hover-primary-text
:hoverbackground-color$hover-ui
:activebackground-color$active-ui
:focusborder$focus
:disabledtext color$disabled-03
:disabledsvg$disabled-02
Ghost button states and color

Primary danger button

ClassPropertyColor token
.bx--btn--danger--primarytext color$text-04
.bx--btn__iconsvg$icon-03
.bx--btn--danger--primarybackground-color$danger-01
:hoverbackground-color$hover-danger
:activebackground-color$active-danger
:focusborder$focus
:focusinset$ui-background
:disabledbackground-color$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-03
Primary danger button states and color

Tertiary danger button

ClassPropertyColor token
.bx--btn--danger--tertiarytext color$danger-02
.bx--btn__iconsvg$danger-02
.bx--btn--danger--tertiaryborder$danger-02
:hoverbackground-color$hover-danger
:hovertext color$text-04
:hoversvg$icon-03
:activebackground-color$active-danger
:activetext color$text-04
:activesvg$icon-03
:focusborder$focus
:focusinset$ui-background
:disabledbackground-color$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-03
Tertiary danger button states and color

Ghost danger button

ClassPropertyColor token
.bx--btn--danger--ghosttext color$danger-02
.bx--btn__iconsvg$danger-02
:hoverbackground-color$hover-danger
:hovertext color$text-04
:hoversvg$icon-03
:activebackground-color$active-danger
:activetext color$text-04
:activesvg$icon-03
:focusborder$focus
:focusinset$ui-background
:disabledbackground-color$disabled-02
:disabledtext color$disabled-03
:disabledsvg$disabled-03
Ghost danger button states and color

Typography

Button text should be set in sentence case, with only the first word in a phrase and any proper nouns capitalized.

ClassFont-size (px/rem)Font-weightType style
.bx--btn14 / 0.875Regular / 400$body-short-01

Structure

A button cannot have any element or text within 16 pixels / 1 rem of its borders. For button groups, the primary button is positioned on the outside of the set, while the secondary button is positioned inside. For a button with a glyph, the space between the button label and the glyph must be greater than or equal to 16 pixels / 1 rem. This is to accommodate for instances where two or more buttons with glyphs appear together.

ClassPropertypx / remSpacing token
.bx--btnpadding-left16 / 1$spacing-05
.bx--btnpadding-right64 / 4–
.bx--btn--smpadding-left16 / 1$spacing-05
.bx--btn--smpadding-right64 / 4–
.bx--btn--ghostpadding-left, padding-right16 / 1$spacing-05
.bx--btn__iconmargin-left, margin-right16 / 1$spacing-05
svgsize16 x 16–
:focusbox-shadow: inset1px–
General button structure

Structure measurements for buttons | px / rem

The following specs are not built into any of the button components but are recommended by design as the proper distance between buttons.

AttributePropertypx / remSpacing token
External: buttonmargin1px-
Button pairingsmargin-left, margin-right0–

Sizes

There are three common button sizes: default, field, and small. Each button type can use any of these three sizes based on need. The fourth button size, full bleed, has a more reserved application and should rarely be used.

Button sizeHeight (px / rem)Use case
Full bleed64 / 4Use when buttons bleed to the edge of a component, like in side panels and modals.
Default48 / 3Use as primary page actions and other standalone actions.
Field40 / 2.5Use when buttons are paired with input fields.
Small32 / 2Use when there is not enough vertical space for the default sized button.
Button sizes