Description
The button is a simple component when we use for showing what actions users can do on the page.
Visual style

Parameters
Parameter | Values | Default
-- | -- | --
Style | Primary, Secondary, Link, Facebook, Google, Destructive | Primary
Size | Large, Normal, Small | Normal
Icon | [string] | empty
Label | [string] | Your label
Bordered | [boolean] | false
Disabled | [boolean] | false
Loading | [boolean] | false
Width | [string] | auto
Visual design & design tokens
For all configurations
font-family: $fontFamily
border-radius: $borderRadiusNormal
font-weight: $fontWeightBold
min-width: $widthButtonMinimal
Additional information
- Vertical centering for icon and text label
- For all buttons, there should be a transition for changing states (for background color and scale properties)
- Borders in bordered version are inside the button, so the height of the button stays same
- Width is usually calculated automatically (based on length of label + icon width + paddings). However, it should be possible to set up width manually so there is a chance to have two same-width buttons when placed near each other.
- All buttons should disable all the default browser styling so it doesn’t mess with our own visual style (http://www.456bereastreet.com/i/button_d.png)
Based on selected configuration:
Parameter:Value | property: $token
-- | --
Style:Primary | text color: $colorTextButtonPrimary
icon color: $colorIconButtonPrimary
background: $backgroundButtonPrimary
For bordered version:
text color: $colorTextButtonPrimaryBordered
icon color: $colorIconButtonPrimaryBordered
background: $backgroundButtonBordered
border-color: $borderColorButtonPrimaryBordered
Style:Secondary | text color: $colorTextButtonSecondary
icon color: $colorIconButtonSecondary
background: $backgroundButtonSecondary
For bordered version:
text color: $colorTextButtonSecondaryBordered
icon color: $colorIconButtonSecondaryBordered
background: $backgroundButtonBordered
border-color: $borderColorButtonSecondaryBordered
Style:Link | text color: $colorTextButtonLink
icon color: $colorIconButtonLink
background: $backgroundButtonLink
For bordered version:
N/A (there is no bordered version for this so if someone enable this style together with “bordered”, we'll just ignore it?)
Style:Facebook | text color: $colorTextButtonFacebook
icon color: $colorIconButtonFacebook
background: $backgroundButtonFacebook
For bordered version:
text color: $colorTextButtonFacebookBordered
icon color: $colorIconButtonFacebookBordered
background: $backgroundButtonBordered
border-color: $borderColorButtonFacebookBordered
Style:Google | text color: $colorTextButtonGoogle
icon color: $colorIconButtonGoogle
background: $backgroundButtonGoogle
For bordered version:
text color: $colorTextButtonGoogleBordered
icon color: $colorIconButtonGoogleBordered
background: $backgroundButtonBordered
border-color: $borderColorButtonGoogleBordered
Style:Destructive | text color: $colorTextButtonDestructive
icon color: $colorIconButtonDestructive
background: $backgroundButtonDestructive
For bordered version:
text color: $colorTextButtonDestructiveBordered
icon color: $colorIconButtonDestructiveBordered
background: $backgroundButtonBordered
border-color: $borderColorButtonDestructiveBordered
Size:Large | font-size: $fontSizeTextLarge
height: $heightButtonLarge
padding-left: $paddingButtonLarge
padding-right: $paddingButtonLarge
When button has icon:
padding-left: $paddingButtonLargeWithIcon
Styles for inserted icon:
height: $heightIconMedium
width: $widthtIconMedium
margin-right: $marginButtonIconLarge
Size:Normal | font-size: $fontSizeTextNormal
height: $heightButtonNormal
padding-left: $paddingButtonNormal
padding-right: $paddingButtonNormal
When button has icon:
padding-left: $paddingButtonNormalWithIcon
Styles for inserted icon:
height: $heightIconMedium
width: $widthtIconMedium
margin-right: $marginButtonIconNormal
Size:Small | font-size: $fontSizeTextSmall
height: $heightButtonSmall
padding-left: $paddingButtonSmall
padding-right: $paddingButtonSmall
When button has icon:
padding-left: $paddingButtonSmallWithIcon
Styles for inserted icon:
height: $heightIconSmall
width: $widthtIconSmall
margin-right: $marginButtonIconSmall
Loading:true | Nothing so special, it's basically just a button with specific icon. For this, we'll use animated icon from our old button: Loading button in storybook
Pre-defined configurations
There is few combination we can predefine. All this configuration matches names and look for Sketch symbols from our Orbit UI kit. It should also help with handing designs over to product teams.
This gives us also possibility that for eg. when we change the default icon for a destructive button will be “cross” instead of “remove”, that we don’t need to go through all instances and change it everywhere. We just change that pre-defined configuration for “Destructive button” have “icon” parameter set to “cross” and it’ll change everywhere.
Type | Pre-defined parameters | Usually working with
-- | -- | --
Primary button | Style: Primary
Size: Normal | Size
Label
Disabled
Loading
Primary button with icon | Style: Primary
Size: Normal
Icon: “plus-circle” | Size
Label
Disabled
Loading
Secondary button | Style: Secondary
Size: Normal | Size
Label
Icon
Disabled
Loading
Secondary button with icon | Style: Secondary
Size: Normal
Icon: “plus-circle” | Size
Label
Icon
Disabled
Loading
Destructive | Style: Destructive
Size: Normal
Icon: “remove” | Size
Label
Disabled
Loading
Destructive Light | Style: Destructive
Size: Small
Bordered: true
Icon: “remove” | Size
Label
Disabled
Loading
Facebook | Style: Facebook
Size: Normal
Icon: “facebook” | Size
Label
Disabled
Loading
Google | Style: Google
Size: Normal
Icon: “google” | Size
Label
Disabled
Loading
Button Link | Style: Link
Size: Small
Icon: “plus-circle” | Size
Label
Disabled
Loading
Of course that is possible to define custom configuration but it won’t be recommended and if we decide that we need to use eg. light variants of our buttons more, we can always add another pre-defined state.
Hover & active button states

You can check interactions on this link, Version 5 is the one we choosed: https://codepen.io/darkwindcz/pen/mxJmbP
When are buttons hovered, we use darken()
function for background colors for our button backgrounds in most cases, e.g. darken([original-color], $modifierDarkenHover)
. Same darken modifier is used for text and border colors when button is in “Bordered” version.
When are buttons active, we use darken()
function for background colors for our button backgrounds in most cases, e.g. darken([original-color], $modifierDarkenActive)
. Also, when button is active, we scale it's size down, with the css function transform: scale($modifierScaleButtonActive)
The design token name for darkening value is not tight to buttons as we use the same token for hover state of different components (like <TextLink />
or in the future for <Chip />
, etc.)
There is one exception though. For button style “Link”, we want to use $backgroundButtonLinkHover
instead of darkening pure white. The reason for this is that if we would use darken(#fff, 5%)
, it would generate gray-ish color. But in our color system, we use blue-ish versions of our gray shades. For active state of this button, we just use darken with this vaues: darken($backgroundButtonLinkHover, $modifierDarkenButtonLink)
.
Hover & active states are same for all button sizes and button styles. (With exception of Link type, as mentioned above)
Disabled state should use opacity $opacityButtonDisabled, hover styles should be disabled too so it doesn’t look like there is some interaction behind it.
Focus state should use default browser styling (outline). It’s possible that we'll change it in the future with our own defined box-shadow, but we need to discuss this with designers.
Some inspiration from other’s React components for button component:
https://mineral-ui.com/components/button
http://design-system.pluralsight.com/components/button/
https://seek-oss.github.io/seek-style-guide/button
https://seek-oss.github.io/seek-style-guide/button (there is nice loading animation :-)
https://polaris.shopify.com/components/actions/button#navigation (they have also some accessibility parameters)
http://design.acl.com/component/Button (I like their naming convention for states, eg. isDisabled or isLoading)