
We built a large contact sheet of scenarios and tested our new button components against it.
A complete refactor of arguably the most important component in any ecommerce store. The button. Language, states, size, color, and development patterns all shape how well this one component gets understood.
On the surface, buttons seem like a simple component. Understand how crucial a part they play in the user journey, though, and building a great button component group turns into real work.
What is a Button?
We asked ourselves this question early on, then kept redefining the answer as our UX research went deeper. We had to sharpen it further in the later stages to land on a solid component definition. We landed here: the purpose of our button component is to help users understand what actions are available to them, so they feel confident about what happens next.
Project deliverables available for download in the sidebar.

How many button types do we need? What will their relationships to each other look like?
We reviewed the major action flows through the ecommerce path and CMS content. Three main button types emerged. That lines up with what most other design systems use.
How do we make sure our new design system button component will be suitable for 99% of all user flow scenarios?
We built a large contact sheet of scenarios and tested our new button components against it. From there, we spawned conversations from the results and made small pivots where needed.
We have the button types, states, and usage specs. But what about verbiage? There needed to be a guide for that too.
We’ve done extensive research for UX best practices. These work done here shines through in the final button component definition PDF.
We landed on three button types, ranked from most important actions to least important. Three turned out to be the right number. Two would have overlapped in meaning and confused users. Four would have spread that meaning too thin and confused them a different way.

Button properties are well documented, and generally well understood, so this part came easier than the rest of the component work. We researched which properties needed defining and leaned on common UX practices to lock them in.
This property didn’t behave like the others. It might have slipped past us entirely without the UX research to flag how much it mattered.
We treated verbiage with the same weight as the UI properties, and set out to find a solid answer for how a button’s copy should read. Leading with a verb, and being specific about what happens after the click, mattered more than we expected going in.

We had to be sure we’d covered every angle of how we’d defined the button component. So we took popular user flows and put the button properties to the test against them.

We moved from old-school CSS to Sass, which gave us shorthand syntax plus variables and functions that transpile into browser-ready CSS.
Those functions kept the DRY fundamentals intact. We wrote the common property patterns once, across every button type and state, and injected variables wherever the patterns varied. That came to about 90 lines of code, where the old CSS approach would have run five times the complexity. It also meant whoever wrote the component styles could hand it off and explain it to the rest of the dev team without a struggle.
// Start Button Helper Mixins (functions)
=button-size($padding, $font-size, $icon-size)
padding: $padding
font-size: $font-size
i.fa
font-size: $icon-size
=main-buttons($border-color, $background-color, $color)
border-color: $border-color
background-color: $background-color
color: $color
&:link &:visited
color: $color
&:not([disabled])
&:hover, &:focus
border-color: $border-color
background-color: darken($background-color, 5%)
color: $color
&:not([disabled])
&:active, &:active:hover, &:active:focus
border-color: $border-color
background-color: darken($background-color, 5%)
box-shadow: inset 0 0 10px 5px rgba(0, 0, 0, 0.15)
=tertiary-buttons($border-color, $background-color, $color, $inverted)
border-color: $border-color
background-color: $white
background-clip: padding-box
@if $inverted
border-color: $color
background-color: transparent
color: $color
&:link &:visited
color: $color
&:hover, &:focus
background-color: $border-color
color: $background-color
@if $inverted
background-color: transparent
color: $color
box-shadow: inset 0 0 0 1px $color-silverado
&:active, &:active:hover, &:active:focus
border-color: transparent
background-size: contain
box-shadow: inset 0 0 0 2px $color
@if $inverted
background-color: transparent
// End Button Helper Mixins (functions)
// Start Button Style Selectors
// Button Base
.btn
display: inline-flex
align-items: center
justify-content: center
padding: 10px 15px
border-radius: 4px
font-weight: $font_weight_bold
&:disabled, &[disabled], &[disabled]:hover
border-color: $med-gray
background-color: $light-gray
color: $med-gray
cursor: not-allowed
i.fa
margin: 0 0 0 10px
font-size: 18px
i.fa.fa-shopping-cart, i.fa.fa-lock, i.fa.fa-plus-circle, i.fa.fa-book, i.fa.fa-credit-card
margin: 0 10px 0 0
// Button Size Variations ($padding, $font-size, $icon-size)
.btn-sm
+button-size(5px 10px, 12px, 14px)
.btn-lg
+button-size(15px 30px, 18px, 24px)
i.fa.fa-shopping-cart, i.fa.fa-lock
font-size: 24px
// Button Types ($border-color, $background-color, $color, $inverted)
.btn-primary, a.btn-primary
+main-buttons($orange, $orange, $white) //orange btn
.btn-secondary, a.btn-secondary
+main-buttons($blue, $blue, $light-gray) //blue btn
.btn-tertiary, a.btn-tertiary
+tertiary-buttons($blue, $white, $blue, $inverted: false) //white btn
.btn-inverted, a.btn-inverted
+tertiary-buttons($med-gray, $med-gray, $light-gray, $inverted: true) //invert transparent btn
// End Button Style Selectors
Project deliverables available for download in the sidebar.
A popular ecommerce store needed a well-defined, modern approach to their button component using best UX standards.

Zoro is an established half-billion dollar revenue eCommerce store selling supplies and tools.