Skip to content

Tamagui 3.0 adds a C++ native runtime, flat style props and Tailwind

updated

Tamagui 3.0 has been released, introducing a C++ native style runtime, an improved optimizing compiler, flat style props, React Strict DOM support and a Tailwind frontend, while keeping one UI codebase for React Native and the web.

Native runtime and compiler

@tamagui/native-registry moves theme updates into a small C++ registry and applies changes to eligible native views directly through Fabric, without re-rendering the React components that use them. It is an opt-in beta that requires React Native 0.82 or newer with the New Architecture, installed with Nitro Modules and enabled via the compiler's nativeFastPath output.

The native compiler now handles logical conditions, nested ternaries, multiple conditional props, statically evaluable spreads, styled.dynamic() variants and .resolve() chains when inputs are known at build time. On web, an experimental zero-runtime mode compiles eligible entries to host elements and generated CSS.

Flat style props

Base values and conditions for a property now live in one value, with chainable modifiers such as dark:sm:hover:. Both a string form and an object form are supported:

<View bg="background hover:background-hover" p="4 sm:6" />

Config v6 renames multi-word theme keys to kebab case, such as border-color and background-hover. A Rust-based language server, @tamagui/lsp, provides completions, diagnostics and hover for the new grammar; the VS Code extension has not yet reached the Marketplace.

React Strict DOM and Tailwind

React Strict DOM lets developers author semantic html elements that render on web and native, and @tamagui/tailwind adds utility classes in className using the same compiler, tokens and themes. Components are now split into a styled kit in tamagui and unstyled behavior in @tamagui/ui.

Other changes

  • Explicit style precedence tiers, a standalone style() helper, styled.dynamic() and .resolve().
  • Removed APIs including focusable, fullscreen, themeInverse, $true tokens, token stepping, useProps and usePropsAndStyle; .styleable() becomes createStyledHOC.
  • Sheet.Frame splits into Sheet.Container and Sheet.Background; Dialog, Popover and Select share a unified Adapt handoff.
  • Public animated-number hooks and a typed onTransition lifecycle replacing onDidAnimate.
  • Select multiple, new Field and Form validation with Standard Schema support, a noFocus FocusScope mode, and an optimizeFor setting.
  • <ThemeUpdate> for inline theme values and config variables, which replace defaultProps.
  • @tamagui/lucide-icons-2 is dropped in favor of npx @tamagui/cli icons add.

Migrating

The CLI prints a migration brief:

npx @tamagui/cli migrate --from v2  # For upgrading from v2 (or --from v1)

The upgrade guide covers the breaking change checklist and the flat-values codemod.

Source: github.com