Skip to content

Uniwind, Tailwind bindings for React Native, reaches its first stable release

updated

The first stable release of Uniwind, an open source project for using Tailwind CSS in React Native apps, has been announced. The post's author and Hubert Bieszczad worked on it for 3.5 months, building on what they learned from Unistyles. The author had first announced the project at Callstack's React Universe Conf.

Background

The authors say StyleSheet remains a good way to build mobile apps, but that className offers a unified path for sharing styles across Web, Android and iOS. Uniwind is described as highly inspired by Nativewind, and the post states it is 2.5x faster than Nativewind out of the box. A migration guide from Nativewind is available.

CSS parser

Uniwind includes a custom CSS parser that supports Tailwind 4 syntax and also parses regular CSS files, so a class such as .button defined in CSS can be applied with className="button" alongside Tailwind utilities.

Theming

Beyond the default light and dark modes, any number of custom themes can be registered in the metro plugin:

module.exports = withUniwindConfig(appConfig, {
    cssEntryFile: './src/global.css',
    extraThemes: ['vandetta'],
});

Each theme then gets its own @variant block in global.css, and classes like bg-background change based on the current theme.

React Native bindings

Mappings are included for every component exported from React Native, so className can be used wherever style was used before. For other styling props, a suffixed prop is exposed, for example colorClassName on Button, used with accent- prefixed colors:

<Button colorClassName="accent-primary" />

The new documentation covers topics from monorepo setup and metro configs to available CSS functions and hooks.

HeroUI collaboration

The first beta of HeroUI Native is available and has been fully migrated to Uniwind. HeroUI reports performance gains of up to 250%.

Uniwind Pro

With more than 1,500 developers on the waitlist, a Pro version is expected later this month. It is set to include a 2nd gen. Unistyles C++ engine designed to eliminate re-renders, and a translation layer for className-based animation powered by Reanimated. Interested developers can join the waitlist at uniwind.dev.

Unistyles 4.0

Work on Unistyles 4.0 will begin soon, with goals including performance closer to native StyleSheet, an easier Babel setup, better web support and Expo Go support.

Video

Source: www.reactnativecrossroads.com