More Premium Hugo Themes Premium React Themes

Tamagui

Style React fast with 100% parity on React Native, an optional UI kit, and optimizing compiler.

Tamagui

Style React fast with 100% parity on React Native, an optional UI kit, and optimizing compiler.

Author Avatar Theme by tamagui
Github Stars Github Stars: 12581
Last Commit Last Commit: May 22, 2025 -
First Commit Created: Apr 29, 2023 -
default image

Overview

Tamagui is a complete universal UI kit built for both web and native apps. It includes @tamagui/core, which is a universal style system, and @tamagui/static, an optimizing compiler that works with core and tamagui. The goal of Tamagui is to allow developers to share more code between web and native apps while maintaining a high level of performance and code maintainability. It achieves this through an optimizing compiler that generates platform-specific optimizations and a “CSS-in-JS” style system that can flatten even inline styles with logic into flattened nodes. This results in significant runtime performance improvements.

Features

  • Universal style system: Tamagui includes @tamagui/core, which is a style system that can be used for both web and native apps.
  • Optimizing compiler: Tamagui also includes @tamagui/static, an optimizing compiler that works with core and tamagui. This compiler generates platform-specific optimizations and improves runtime performance.
  • Flattening of styled components: The optimizing compiler can flatten a large percentage of styled components in your app, resulting in improved performance. It understands a rich “CSS-in-JS” style system and can flatten even inline styles with logic into flattened nodes.
  • Atomic CSS and partially evaluated code: The compiler generates atomic CSS and partially evaluated code, which further enhances runtime performance.
  • Easy contribution: Tamagui is a monorepo that makes it easy to contribute to the project.

Installation

To install Tamagui and set up a development environment, follow these steps:

  1. Run the build watcher in a dedicated terminal:

    # Run the build watcher
    npm run watch
    
  2. Use the sandbox project to test and develop things for the web:

    # Use the sandbox project for web development
    npm run sandbox:web
    
  3. To test on native, use the kitchen-sink project:

    # Use the kitchen-sink project for native testing
    npm run kitchen-sink
    
  4. Create a development build:

    # Create a development build
    npm run build:dev
    
  5. Run the site in development mode to test if it works at runtime:

    # Run the site in development mode
    npm run dev
    
  6. If everything looks good, run the site with the compiler enabled:

    # Run the site with the compiler enabled
    npm run dev:compiler
    
  7. Finally, build the site for production and test it:

    # Build the site for production
    npm run build
    

By following these steps, you can ensure that Tamagui works well with various environments and configurations, including Vite, Webpack, Metro, Next.js with SSR, and with the compiler both on and off. Integration tests will be added in the future to cover all combinations of environments.

Summary

Tamagui is a universal UI kit designed for both web and native apps. It includes a universal style system and an optimizing compiler that generates platform-specific optimizations. The compiler can flatten styled components and improves runtime performance by generating atomic CSS and partially evaluated code. Tamagui is easy to contribute to, and developers can set up a development environment by following the provided installation steps.