kristerkari / react-native-css-modules-example

A simple example app that shows how you can use CSS modules with React Native and React (for browser)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native + CSS modules

Platform - Android, iOS and Web contributions welcome

A simple example app that shows how you can use CSS modules with React Native and React (for browser).

Have a look at the src folder to see code examples.

Quick links: Features β€’ Screenshots β€’ Try it β€’ Documentation

Example App features

React Native and Web

React Native specific

Web specific

Supported Browsers

  • Mobile: Android Stock browser (4.4-5.x), Android Chrome, iOS Safari 8+
  • Desktop: Firefox, Chrome, Safari

Try it

Step 1: Install depencies to run React Native

Make sure that you have react-native-cli installed (npm install -g react-native-cli) and XCode (for iOS development) / Android Studio (for Android development) installed and working.

Step 2: Clone the repo and move to project

git clone git@github.com:kristerkari/react-native-css-modules-example.git
cd react-native-css-modules-example

Step 3: Install example app's dependencies

NodeJS packages:

yarn install

and CocoaPods for iOS:

cd ios && pod install

Step 4: Run React Native packager

You can open a new terminal tab to run React Native's packager.

yarn start

Step 5: Run app on Android, iOS or Web

First make sure that your Android emulator or iOS simulator is working, then:

yarn ios

or

yarn android

or

yarn web

Web app can be accessed by opening http://localhost:8080 in a browser.

Screenshots

iOS - Android - Web

About

A simple example app that shows how you can use CSS modules with React Native and React (for browser)


Languages

Language:JavaScript 47.1%Language:Kotlin 12.0%Language:Objective-C 11.2%Language:CSS 9.0%Language:SCSS 7.4%Language:Ruby 7.3%Language:Objective-C++ 3.9%Language:HTML 2.1%