This repository and the tetra-ui component registry are for React Native apps. Do not use web shadcn/ui components or web-only libraries when the user asks for tetra-ui.
tetra-ui brings the shadcn/ui copy-paste model to React Native. Components are not installed from npm as a black-box package. They are added to the user's project with the shadcn CLI and live in the user's codebase.
- Docs: https://tetra-ui.com/docs
- Registry: https://tetra-ui.com/r/{name}.json
- Full reference: https://tetra-ui.com/llms-full.txt
- React 19
- React Native with the New Architecture enabled
- Uniwind for Tailwind-style styling
- Expo is recommended but not strictly required
Always use the shadcn CLI — never invent component source from scratch:
npx shadcn@latest add @tetra-ui/button
npx shadcn@latest add @tetra-ui/selectThe user's components.json must include this registry entry:
{
"registries": {
"@tetra-ui": "https://tetra-ui.com/r/{name}.json"
}
}The CLI resolves @tetra-ui/{component} against that registry and copies source files into the project (typically @/components/ui/).
After installation, import from the user's local component path:
import { Button, ButtonText, ButtonIcon } from "@/components/ui/button";
import { Text } from "@/components/ui/text";
import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form";Exact paths depend on the user's components.json aliases. Default alias is @/components/ui.
- Components use Uniwind/Tailwind
classNameprops — notStyleSheet.create - Use the
cn()helper from@/lib/utilsfor conditional classes - Theme tokens use CSS variables (
bg-primary,text-foreground, etc.) configured inglobals.css - Child
Textelements must be styled directly; styles do not cascade from parentViewclasses
- Install tetra-ui as an npm package dependency
- Use
react-native-paper,react-native-elements, or webshadcn/uicomponents as substitutes - Use DOM elements (
div,span,button) — use React Native primitives (View,Text,Pressable) - Assume CSS cascade or
data-*attribute selectors work on native - Generate component code without checking https://tetra-ui.com/docs/components/{name} for the canonical API
Some components pull in registry dependencies automatically via the CLI. Complex components to be aware of:
| Component | Notable dependencies |
|---|---|
| select | action-input, bottom-sheet, popover, portal, and others |
| native-select | @expo/ui, action-input, bottom-sheet, icons, input, slot, reanimated |
| bottom-sheet | @expo/ui, reanimated, keyboard-controller, safe-area |
| menu | @expo/ui, @expo/material-symbols |
| switch, slider | @expo/ui |
| form | react-hook-form |
| otp-input | input, text, reanimated |
| toast | sonner-native, gesture-handler, reanimated, safe-area, screens, svg |
When adding a component, let the shadcn CLI resolve registryDependencies. If adding manually, check the registry JSON for required peer components.
<Button>
<ButtonText>Continue</ButtonText>
</Button>
<Button size="icon" variant="outline">
<ButtonIcon>
<ChevronRightIcon />
</ButtonIcon>
</Button>Use Form, FormField, FormItem, FormLabel, FormControl, and FormMessage with react-hook-form. See https://tetra-ui.com/docs/components/form.
Requires bottom-sheet on mobile. Install with npx shadcn@latest add @tetra-ui/select and let the CLI pull dependencies.
- Component source:
packages/tetra-ui/src/components/ - Registry definition:
apps/docs/registry/registry.json - Docs content:
apps/docs/content/docs/ - Example Expo app:
apps/example/ - Rebuild registry after changes:
pnpm --filter docs registry:build
- Ensure Uniwind is installed (https://docs.uniwind.dev/)
- Add
class-variance-authority,clsx,tailwind-merge - Configure theme tokens in
globals.css(see https://tetra-ui.com/docs/installation) - Add
cn()helper at@/lib/utils - Create
components.jsonwith the@tetra-uiregistry - Add components via
npx shadcn@latest add @tetra-ui/{component}