Native
The native style runtime and the integrations that make Tamagui feel native on iOS and Android
Tamagui renders real native views on iOS and Android, with the same components, tokens, and themes you use on web. Nothing extra is required to get started. The runtime and integrations below make it faster and more native once you need them.
Configure Tamagui with the same provider on native and web.
Native runtime
The native runtime is in beta. It needs React Native 0.82 or newer with the New Architecture (Fabric).
By default, a theme change or a style update re-renders the React components that
use it. @tamagui/native-registry moves that work into a small C++ registry. It
links eligible native views to the registry and applies theme and style updates
directly through Fabric, so the components don’t re-render.
Install it along with Nitro Modules, then rebuild your iOS and Android binaries:
yarn
npm
bun
pnpm
Turn on the compiler output in tamagui.build.ts:
Register the style engine once at startup, before your app tree mounts:
If the native module isn’t available on a platform, components render the normal React way, so the same code is safe everywhere.
Integrations
@tamagui/native connects Tamagui to popular React Native libraries. Each
integration is opt-in: install the library, then import its setup module at your
app entry point, before any Tamagui imports.
yarn
npm
bun
pnpm
| Integration | Library | What you get |
|---|---|---|
| Gesture Handler | react-native-gesture-handler | Correct nested presses, native Sheet drag and scroll |
| Portals | react-native-teleport | Portaled content that keeps your React context |
| Reanimated | react-native-reanimated | Animations on the UI thread |
| Keyboard Controller | react-native-keyboard-controller | Sheets that track the keyboard frame by frame |
| Safe Area | react-native-safe-area-context | The safe style value and safe area aware sheets |
| Menus | @expo/ui or zeego | Platform menus and context menus |
| Toast | burnt | System toasts and indicators |
- Integration
- Gesture Handler
- Library
react-native-gesture-handler- What you get
- Correct nested presses, native Sheet drag and scroll
- Integration
- Portals
- Library
react-native-teleport- What you get
- Portaled content that keeps your React context
- Integration
- Keyboard Controller
- Library
react-native-keyboard-controller- What you get
- Sheets that track the keyboard frame by frame
- Integration
- Safe Area
- Library
react-native-safe-area-context- What you get
- The
safestyle value and safe area aware sheets
A typical entry file with several integrations looks like this:
In a monorepo, install the native libraries in the app package, since native modules are linked from there.
Gesture Handler
With React Native Gesture Handler, onPress works the way React Native
Pressable does: when pressables are nested, only the innermost one fires. Sheet
also uses it to hand off smoothly between dragging the sheet and scrolling its
content.
yarn
npm
bun
pnpm
To use it for only one of the two, call setupGestureHandler instead:
With press events enabled, onPress calls stopPropagation() on web as well, so
nested pressables behave the same on both platforms. Use onClick on web when you
want normal DOM bubbling.
PressBoundary
Tamagui pressables coordinate with each other automatically. A React Native
Pressable or a custom native wrapper doesn’t take part in that, so tapping it can
also fire a Tamagui pressable around it. Wrap it in PressBoundary to stop that:
PressBoundary only affects Tamagui pressables. It doesn’t change how React
Native events bubble in general. Native Menu.Trigger and ContextMenu.Trigger
already do this for you.
Portals
On native, Tamagui’s default portal re-mounts content at the root, which cuts it
off from the React context it was declared in. With react-native-teleport,
content inside Sheet, Dialog, Popover, and other portaled components keeps your
contexts, such as navigation and app state.
yarn
npm
bun
pnpm
In a One app, One’s native portals do the same job without another native library:
Use one of the two setups, not both.
See Portal for details.
Reanimated
Reanimated runs animations on the UI thread, so they stay smooth while JavaScript is busy. It plugs in as an animation driver, so it needs no setup import:
yarn
npm
bun
pnpm
See the Reanimated driver for configuration, and animation drivers to use it on native with a lighter driver on web.
Keyboard Controller
With react-native-keyboard-controller, Sheet follows the keyboard frame by frame
as it opens and closes, and dragging the sheet can dismiss the keyboard
interactively.
yarn
npm
bun
pnpm
Safe Area
This setup lets styles use the device safe area insets, and Sheet uses it to stay clear of the notch and home indicator.
yarn
npm
bun
pnpm
SafeAreaProvider has to wrap TamaguiProvider. Then pass safe to any padding
or margin prop, or to top, bottom, left, right, and inset:
On web, safe becomes the CSS env(safe-area-inset-*) value, so the same code
works in the browser without this setup.
Menus
Menu and ContextMenu can render the platform’s own menus, with system haptics
and blur, when you pass the native prop.
yarn
npm
bun
pnpm
The Zeego adapter is still available for apps on React Native versions it supports:
yarn
npm
bun
pnpm
See Menu and ContextMenu.
Toast
With burnt, toasts use the system UI: SPIndicator on iOS, ToastAndroid on
Android, and the Notification API on web.
yarn
npm
bun
pnpm
See Toast.