UI Kit tokens
UI Kit tokens are the semantic layer of the UI Kit system, providing consistent, and themeable values for UI development. They ensure design integrity, maintainability, and seamless alignment between design and implementation.
Think of UI Kit tokens as the handshake between design and development. They keep everyone on the same page - so always use them to ensure things stay consistent and clean.
UI Kit tokens can be accessed through the theme
object:
import { theme } from "@hitachivantara/uikit-react-core";
const MyComponent = () => (
<div style={{ color: theme.colors.primary }}>
This text uses the semantic primary color.
</div>
);
These tokens are categorized into several groups, each serving a specific purpose in the UI Kit design system and can be
accessed through the theme
object.
When creating a new theme, you can extend any of the supported themes by overriding these tokens (or adding new ones). This allows you to customize the UI Kit to fit your brand or application needs while maintaining the core design principles.
Check the Color tokens page for more information on how to use color tokens in your components.
Below is a summary of the available token categories:
Radii
Accessible through the theme.radii
object, these tokens define the border radius values used across the UI Kit components.
none
base
round
large
full
Spacing
Accessible through the theme.spacing
object, these tokens define the spacing values used for margins, paddings, and gaps in the UI Kit components.
base
xxs
xs
sm
md
lg
xl
ZIndex
Accessible through the theme.zIndex
object, these tokens define the stacking order of UI Kit components.
hide
base
docked
sticky
fab
banner
overlay
modal
dropdown
popover
tooltip
skipLink
toast
Typography
These tokens define the typography styles used in the UI Kit components.
fontFamily
body
fontSizes
xs
sm
base
lg
xl
xl2
xl3
xl4
fontWeights
hairline
thin
light
normal
medium
semibold
bold
extrabold
black
lineHeights
none
xs
sm
base
lg
xl
xl2
xl3
xl4
Breakpoints
Accessible through the theme.breakpoints
object, these tokens define the responsive breakpoints used in the UI Kit components.
xs
sm
md
lg
xl