Variables represent dynamic or templated values, such as event properties, column references, or liquid template variables.
Use the fallbackValue prop to show a fallback value alongside the variable name. The fallback is displayed in a filled section to distinguish it visually.
By default, Variable inherits its color from the surrounding context. Pass a color prop (or wrap it in any element with a color style) to recolor it. The border and fallback background are derived from the resolved text color in OKLCH, so any color value works — semantic text tokens (e.g. text.primary, text.danger), palette tokens (e.g. purple.base, red.600), or raw CSS colors.
The examples below show common semantic tokens. Any other color from the theme — or any CSS color value — can be used the same way.
text.primary
first_name
"there"text.secondary
first_name
"there"text.tertiary
first_name
"there"text.disabled
first_name
"there"text.success
first_name
"there"text.warning
first_name
"there"text.danger
first_name
"there"purple.base
first_name
"there"pink.base
first_name
"there"indigo.base
first_name
"there"text.upsell
first_name
"there"link.default
first_name
"there"Variable inherits its font size from the surrounding context, rendering 1px smaller than the parent text. The box height and padding scale with the inherited font size. To resize, either set fontSize on the parent (recommended — the surrounding text stays in sync) or pass fontSize directly on the Variable to opt out of inheritance.
Drag the slider to change the parent's font size — both the surrounding Text and the Variable track it together.
To override the inherited size on a single Variable, pass fontSize directly:
Use the fontWeight prop to control the visual emphasis of the variable. Defaults to "normal".
normal (default) for most cases.medium to match surrounding medium-weight text contexts.semibold to draw additional emphasis to a variable.Variable inherit from its surroundings whenever possible — that's the most consistent option.text.primary, text.secondary, text.tertiary, text.placeholder, text.disabled) for emphasis or de-emphasis in denser layouts.text.success, text.warning, or text.danger to align with the semantic tone of nearby content.purple.base, red.600) only when no semantic token fits.first_name, not First Name).Inherits margin props.
| Name | Default | Description |
|---|---|---|
children | — | ReactNodeThe variable name to display. |
fallbackValue | — | stringWhen provided, renders a fallback section appended to the variable name. The fallback section has a filled background to distinguish it visually. |
fontWeight | "normal" | "normal" | "medium" | "semibold"Font weight. |