One Guide
How to set up Tamagui with One
One is a Vite-based React framework for web, iOS, and Android with built-in Tamagui integration.
Install
First, create a new One project:
yarn
npm
bun
pnpm
Add Tamagui and its dependencies. @tamagui/cli carries the Vite plugin used
below, alongside the CLI and the other bundler integrations:
yarn
npm
bun
pnpm
Configuration
Create a tamagui.config.ts file in your project root:
tamagui.config.ts
Update your vite.config.ts:
vite.config.ts
Setup Tamagui Provider
Update your root layout file (typically app/_layout.tsx):
app/_layout.tsx
Usage
Now you can use Tamagui components in your One app:
app/index.tsx
Themes
To support light and dark modes, use One’s built-in color scheme support along with Tamagui’s theming system. Update your root layout:
app/_layout.tsx
Performance
For better performance, use the outputCSS option in the Tamagui Vite plugin:
vite.config.ts
Then import the CSS in your root layout:
app/_layout.tsx
Next Steps
You now have Tamagui set up with One.