wwwwwwwwwwwwwwwwwww
Tamagui
Universal UI for React Native and web
Tamagui is a style library and UI kit that works across React and React Native. It provides a typed styling system, an optimizing compiler, and a complete set of components - all designed to share code between platforms without sacrificing performance.
Why Tamagui
Cross-platform styling usually means runtime overhead on web or limited capabilities on native. Tamagui solves this with a compiler that outputs optimized, platform-specific code from a single source.
- Optimizing compiler - Compiler extracts styles and flattens logical components to achieve ideal performance
- Full React Native API - Complete compatibility with RN, with zero outside dependencies (including even React Native itself)
- Type-safe tokens - Colors, spacing, and typography with full IntelliSense
- Theme system - CSS variables on web, no re-renders on theme change
The Compiler
Tamagui’s compiler transforms styled components at build time:
Input:
Web output:
The compiler:
- Extracts styles to atomic CSS classes
- Flattens nested styled components
- Eliminates runtime style computation
- Tree-shakes unused styles
Takeout Integration
Takeout configures Tamagui with:
- Three animation drivers - CSS for static pages, Motion for web dynamic pages, reanimated for native dynamic pages
- Dark and light themes - With
$theme-darkand$theme-lightconditional styling - Group selectors -
$group-button-hoverfor parent-scoped states - Pre-built components - Buttons, inputs, modals, and more
Basic Usage
Learn More
Edit this page on GitHub.