Skip to content

Tokens & States

Tokens & States 🔗

Color tokens are design decisions, translated into data. They act as a “source of truth” to help ensure that product experiences feel unified and cohesive.

Introduction

Tokens are our way to apply visual foundations in our react based applications.

Tokens are name and value pairings that represent small, repeated design decisions. A token can be color, font style and size or even a unit of white space.

One of the most important topics are accessibility. And tokens are a great way to ensure that what we do in our applications has the right contrasts in order to secure a good user experience.


Color Tokens

The way our color tokens are structured is that they all have their base in our palette. From there by making a token for each design decision we ensure that each decision is maintained properly.

  • Color tokens consist of a shade or value from our palette.

  • By picking colors from our list of color tokens instead of directly from our palette. We ensure that the right color is used at the right time to a higher degree than by using our palette directly.

PropertyDescription
Surface

Used for bigger elements in order to make hierarchy and depth on pages

Background

Colors for backgrounds on smaller elements and components such as buttons, badges, inputs and more

Stroke

Used to make elements stand out and increase variant and/or contrast on background.

TextColors designated for text use only
IconColors designated for iconography use only

By following the same pattern on each of these categories you end up with colors working together.

Example uses of font types Example uses of font types

Illustration: The first word in any token tells us what kind of token it is. Color, spacing or Border radius token. Spacing and border radius tokens falls under the category “value tokens” as they are built up of a single value. And are means to secure that we are using the correct amount of “white space” in our applications


PropertyRoleEmphasisState
Surface
Background
Stroke
Text
Icon
dangersolidhover

Illustration: Shows how a token color state could look like for a component


Component States

  • Default : Used for the default state of a component
  • Hover : Occurs when hovering over a component
  • Active : The active state of a component (on / off)
  • Focus : When tabbing to a component or giving focus through other means
  • Disabled : When the component is not interactable and out of potential of focus
  • OnClick : In the process of clicking a component

Value Tokens

Radius

NamePixelRem
radius.none0 px0 rem
radius.tiny2 px0.2 rem
radius.small4 px0.4 rem
radius.medium6 px0.6 rem
radius.large8 px0.8 rem
radius.xlarge10 px1 rem
radius.xxlarge12 px1.2 rem
radius.round200 px20 rem

Spacing

NamePixelRem
spacing.none0 px0 rem
spacing.tiny4 px0.4 rem
spacing.small8 px0.8 rem
spacing.medium12 px1.2 rem
spacing.large24 px2.4 rem
spacing.xlarge48 px4.8 rem

Tokens in Figma

All tokens can be found as Local variables
Here we make our tokens and they are divided into seperate lists.

  • 01.Palette
  • 02.Colors
  • 03.Value tokens

How to find color tokens part 1 How to find color tokens part 2