Colors
Colors help you communicate the structure of your UI, emphasize any important information, or signal different states of the UI. Use colors intentionally — they are not decoration and should always serve a purpose.
👉 All colors on this page can be changed by overriding values in your design tokens.
General Guidelines
- Most colors in React UI are semantic: they bear a meaning and target a specific use case. The only non-semantic exception is the neutral colors that are included in React UI due to their frequent usage in UI designs.
- React UI does not try to suggest any global color palettes. Instead, you are encouraged to pick any color palettes you want and map them onto the semantic colors of React UI.
- In general, colors in React UI can be used for either static (most of the text colors and most of the background colors) or interactive use cases (action colors, feedback colors). However, some colors are designed to be either: neutral colors can be used for static and interactive parts similarly to the primary border color.
- Interactive color variants always define hover and active (pressed) states.
- Action, feedback, and neutral colors suggest what color should be used for
the text placed on them. You don't have to think if black or white makes a
better contrast — just use
on-primaryfor text on primary color background oron-successfor success color background, and you should be safe.
Text Colors
Colors reserved for text. Base text can have primary or secondary priority,
while both priorities can be suppressed with the disabled variants. Last but
not least, the text colors define the color of links.
Action Colors
Action colors communicate the importance of an action which can be primary or secondary. Using the selected color, you can also mark an action as the currently selected.
Use the on-* color for text and icons placed on an action color, e.g.
action-on-primary on action-primary.
Feedback Colors
Feedback colors help communicate a meaning: green means success, orange means warning, and red means danger or error. On top of that, there are a few more feedback colors to fit various design situations.
Use the on-* color for text and icons placed on a feedback color, e.g.
feedback-on-success on feedback-success.
State Colors
State colors reflect the state of data in form fields. Valid, warning, and invalid states look like the success, warning, and danger feedback colors by default, but they are separate and can be customized independently. The changed state has a color of its own.
State colors are meant for borders, for text on the surrounding
content layer, and for checked checkboxes, radios, and
toggles. Form fields use them this way for their border, label, and help text.
They are not meant as fills for text, so they have no on-* colors.
Neutral Colors
Neutral colors are intended for neutral variants of components that support colors. The light color works well with dark backgrounds. Conversely, the dark color stands out on light backgrounds.
Use the on-* color for text and icons placed on a neutral color:
neutral-on-light on neutral-light and neutral-on-dark on neutral-dark.
Background Colors
Colors reserved for backgrounds.
Content Layers
Backgrounds for the fundamental UI areas and content layering:
background-basefor the bottom-most layer of your UI,background-layer-1for regular content, e.g. Card, Paper, and Tabs,background-layer-2for overlays, e.g. Modal and Popover.
Layers 1 and 2 can share a color in a light theme, but keep them apart: a dark theme needs them to differ.
👉 Content layers can be separated from background using their
shadow counterparts: background-layer-1 +
shadow-layer-1 etc.
Component Backgrounds
Basic backgrounds for components.
💡 What is the difference between background-base and background-basic?
While the base background is intended for the bottom-most layer of your UI,
the basic background is the default go-to background for components.
Interactive Areas
Backgrounds to highlight interactive areas on hover and during interaction.
💡 Please note the default interactive background is always transparent, so it does not stand in the way of the underlying component background.
Action Backgrounds
Light tints of the action colors. Flat
Buttons use them on hover and when pressed, and selected
Buttons use background-selected.
Feedback Backgrounds
Backgrounds for feedback surfaces, such as Alert, Modal, and flat Buttons on hover and when pressed. Pair them with feedback colors.
State Backgrounds
Backgrounds for components whose data is in a state, such as form fields. Pair them with state colors.
💡 State backgrounds may match feedback backgrounds, e.g.
background-state-valid and background-success, but they are separate so
you can customize states independently of feedback.
Neutral Backgrounds
Neutral backgrounds to help you structure your content.
Border Colors
Colors reserved for borders. With borders, you can separate content areas, components, or their parts. For interactive context, you should always use the primary border.
Applying Colors
Components can apply colors above using one or more following approaches.
Color Collections
Some components (Alert, Badge,
Button, and more) come in more color variants to help you
better reflect their place in content hierarchy or the meaning of their content.
In such cases, one or more Color Collections are always
used. There is always a reasonable default color for the component in question
that can be changed to any of supported collection values through the color
prop.
States
All form field components that support states (CheckboxField, TextField, Toggle and more) apply state colors for individual states:
state-validcolor for valid state,state-warningcolor for warning state,state-invalidcolor for invalid state,state-changedcolor for changed state.
State is always optional. Default styling is applied for the given component
when its state prop is not specified.