Skip to content

Style React Native components using CSS, PostCSS, Sass, Less or Stylus.

License

Notifications You must be signed in to change notification settings

kristerkari/react-native-css-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 

Repository files navigation

React Native CSS modules

Quick links: FeaturesDocumentationExamples

A guide for using CSS modules (with some limitations) for both Web React and React Native.

Why?

React Native does not offer any kind of built-in support for loading CSS from .css files and using it for styling. Many of us are already using CSS modules in an existing project and want to continue using CSS modules when developing React Native apps.

So far the only way has been to use React Native's style property or any of the available CSS-in-JS libraries. Now you can use className property and keep your styles in separate CSS files.

Features

React Native CSS modules Example Apps

Have a look at the example apps to see how you can use CSS modules for both React Native and Web using the same code.

Documentation

Setup

Other docs


Special thanks

The idea for React Native CSS modules comes from these projects that have made a lot of work for supporting CSS and CSS modules in React Native: css-to-react-native and react-native-sass-classname. A big thanks to them!