SwipeUI
DocsTheming & motion

Tokens

The colours, radii and type scale every SwipeUI item is styled with.

SwipeUI items never use raw colours or arbitrary sizes. They use tokens: CSS variables in your global.css, which Uniwind turns into class names such as bg-primary, rounded-md and text-headline. Change a token and every item follows. In CI, an audit rejects any item that uses a raw colour or a value off these scales.

Colours

The names follow shadcn's, which React Native Reusables and AI agents already know, plus a few SwipeUI additions. Each is a --color-<name> variable and a colour class (bg-, text-, border-).

TokenUsed for
background, foregroundScreen background and text
card, card-foregroundRaised surfaces
popover, popover-foregroundMenus and sheets
primary, primary-foregroundMain actions
secondary, secondary-foregroundSecondary actions
muted, muted-foregroundSubtle backgrounds and secondary text
accent, accent-foregroundHighlights
destructive, destructive-foregroundDestructive actions
border, input, ringBorders, input borders and switch tracks, focus rings
surface, surface-elevatedNavigation surfaces such as tab bars and drawers
glass-tintThe optional tint over Liquid Glass (tinted)
tab-active, tab-inactiveTab bar icon and label states

Radii

ClassDefault
rounded-sm6
rounded-md10
rounded-lg14
rounded-xl20
rounded-full9999

Spacing uses Tailwind's default scale.

Type scale

The iOS text styles at their default Dynamic Type size. The sizes scale with the user's text size setting.

ClassSize (pt)Weight
text-large-title34Regular
text-title-128Regular
text-title-222Regular
text-title-320Regular
text-headline17Semibold
text-body17Regular
text-callout16Regular
text-subheadline15Regular
text-footnote13Regular
text-caption-112Regular
text-caption-211Regular

Use them through the Text component's variant. Merge classes with cn, which knows these are sizes, not colours.

In code

For places a class can't reach, such as Reanimated styles or an icon's colour prop, the tokens item has the names and scales as TypeScript values. Read a colour with Uniwind's useCSSVariable:

components/tab-icon.tsx
import { useCSSVariable } from 'uniwind';
import { colorVariable } from '@/components/swipeui/lib/tokens';

const tint = useCSSVariable(colorVariable('tab-active'));

On this page