Skip to content

Styling & Themes

Components accept an appearance prop — a JSON configuration object that controls colors, fonts, spacing, and other visual properties.

Prebuilt themes

Three themes are available out of the box:

// Default — pill-shaped inputs, bold borders
<AddressEntry appearance={{ theme: 'default' }} />
// Minimal — square corners, subtle borders, compact
<AddressEntry appearance={{ theme: 'minimal' }} />
// Rounded — large radii, soft shadows, spacious
<AddressEntry appearance={{ theme: 'rounded' }} />

Overriding design tokens

Use variables to override individual tokens on top of a theme:

<AddressEntry
appearance={{
theme: 'minimal',
variables: {
colorPrimary: '#003366',
colorPrimaryHover: '#002244',
fontFamily: '"Inter", sans-serif',
borderRadius: '12px',
},
}}
/>

Available tokens

Colors

TokenDescription
colorPrimaryButton background, focus ring, active states
colorPrimaryHoverButton hover background
colorPrimaryTextText on primary background
colorBackgroundComponent background
colorTextPrimary text color
colorTextSecondaryPlaceholders, hints
colorBorderInput border
colorBorderFocusInput border on focus
colorErrorError text and borders
colorFocusRingFocus ring shadow (rgba recommended)
colorErrorFocusRingError focus ring
colorSuggestionHoverDropdown hover background
colorDividerDivider between suggestions

Typography

TokenDescription
fontFamilyFont stack for all text
fontSizeBase font size
fontSizeSmallLabels, hints, errors
fontWeightMediumButton and label weight

Spacing

TokenDescription
spacingStandard padding
spacingTightCompact spacing (icon gaps)
spacingWideSection margins, form field margins

Shape

TokenDescription
borderRadiusPill-shaped elements (input, buttons)
borderRadiusInnerDropdown, form inputs
borderWidthInput border width

Shadows

TokenDescription
shadowFocusFocus ring box-shadow
shadowDropdownSuggestion dropdown shadow

Sizing

TokenDescription
inputMinHeightInput wrapper minimum height
buttonHeightSubmit button height
buttonPaddingXButton horizontal padding

How it works

The appearance object is resolved into a complete set of design tokens (resolveAppearance()), then translated to CSS custom properties (appearanceToCSSVars()), and applied as inline styles on the component’s root container. The CSS module references these variables with no fallbacks — all visual values come from the theme.

This means you can render multiple instances with different themes on the same page, and each one is independently styled.

Need more control?

If the appearance tokens don’t cover your needs, you can build fully custom components using the client-js-core API directly. See the Custom UI guide.