Interpolation

Yamada UI provides a feature for easily accessing CSS custom properties (variables) or tokens from the theme.

Overview

Interpolation is a feature for referencing CSS custom properties (variables) or tokens from the theme.

Usage

You can reference the property name set with CSS custom properties (variables) using {custom-property-name}.

Box

Reference Theme Tokens

Yamada UI Style Props only reference the corresponding tokens from the theme. For example, borderRadius references tokens from radii, but not from spaces. By using {}, you can reference tokens outside of the corresponding ones.

Box
Box

Additionally, by using {} within strings, you can reference tokens from the theme. This is useful for shorthand properties such as border.

Box
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd
2nd