Using your existing theme
How init fits SwipeUI's tokens into React Native Reusables, shadcn and HeroUI Native themes.
init never changes a token you already have. It reads your global.css, works out which theme you use, and adds only the SwipeUI tokens that are missing. The additions go in one marked block at the end of the file, which you're free to edit:
/* swipeui:theme:start · Added by npx @swipeui/cli init. … */
/* swipeui:theme:end */Running init again adds nothing unless a token is missing.
React Native Reusables or shadcn tokens
Their colour names are SwipeUI's, so most tokens already exist. init derives the SwipeUI additions from your own colours, so they follow your palette and both themes:
| Added token | Derived from |
|---|---|
surface | var(--color-card) |
surface-elevated | var(--color-secondary) |
glass-tint | card mixed with transparency (60% light, 80% dark) |
tab-active | var(--color-primary) |
tab-inactive | var(--color-muted-foreground) |
destructive-foreground | var(--color-primary-foreground) |
Missing radius and type-scale tokens get SwipeUI's defaults.
HeroUI Native
HeroUI Native defines its own theme variables, and init points SwipeUI's tokens at them: for example primary uses --accent, destructive uses --danger and card uses --surface.
Two names mean different things
HeroUI Native already defines muted (a text colour) and accent (its brand colour). SwipeUI
uses both as background colours. init keeps HeroUI's values so HeroUI's own components look
right, so SwipeUI components that use bg-muted or bg-accent look different in a HeroUI
project. You can redefine --color-muted and --color-accent in the SwipeUI block instead, but
HeroUI's own components will then use your values too.
No theme yet
init writes SwipeUI's default palette in light and dark, the radius scale and the type scale.
NativeWind
SwipeUI is styled with Uniwind, and init stops if it finds NativeWind. Uniwind has a migration guide.