{"id":17963352,"url":"https://github.com/kristerkari/react-native-css-modules-example","last_synced_at":"2025-03-25T05:32:15.933Z","repository":{"id":66125986,"uuid":"117699714","full_name":"kristerkari/react-native-css-modules-example","owner":"kristerkari","description":"A simple example app that shows how you can use CSS modules with React Native and React (for browser)","archived":false,"fork":false,"pushed_at":"2024-11-18T03:19:30.000Z","size":5042,"stargazers_count":14,"open_issues_count":6,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T09:13:43.038Z","etag":null,"topics":["css","css-modules","demo-app","example","react-native","sass"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kristerkari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-16T15:12:59.000Z","updated_at":"2024-08-25T09:20:33.000Z","dependencies_parsed_at":"2024-04-22T04:39:29.020Z","dependency_job_id":"95a245a0-f3cf-4616-9ec2-40aaf6755845","html_url":"https://github.com/kristerkari/react-native-css-modules-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristerkari","download_url":"https://codeload.github.com/kristerkari/react-native-css-modules-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407586,"owners_count":20610228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-modules","demo-app","example","react-native","sass"],"created_at":"2024-10-29T11:34:45.636Z","updated_at":"2025-03-25T05:32:15.242Z","avatar_url":"https://github.com/kristerkari.png","language":"JavaScript","readme":"# React Native + CSS modules\n\n![Platform - Android, iOS and Web](https://img.shields.io/badge/platform-Android%20%7C%20iOS%20%7C%20Web-blue.svg)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\nA simple example app that shows how you can use CSS modules with React Native and React (for browser).\n\nHave a look at the [src](/src) folder to see code examples.\n\n**Quick links:** **[Features](#example-app-features)** • **[Screenshots](#screenshots)** • **[Try it](#try-it)** • **[Documentation](https://github.com/kristerkari/react-native-css-modules#documentation)**\n\n\u003ca href=\"https://facebook.github.io/react-native/\"\u003e\u003cimg src=\"images/react-native-logo.png\" width=\"160\"\u003e\u003c/a\u003e\u003cimg src=\"images/plus.svg\" width=\"100\"\u003e\u003ca href=\"https://github.com/css-modules/css-modules\"\u003e\u003cimg src=\"images/css-modules-logo.svg\" width=\"170\"\u003e\u003c/a\u003e\n\n## Example App features\n\n#### React Native and Web\n\n- :tada: Allows `className` and `style` properties to be used on React Native elements such as `\u003cText\u003e` or `\u003cView\u003e`.\n- :fire: CSS Hot loading (live reloading).\n- :ok_hand: Uses [Sass](src/Buttons.scss) and [CSS](src/ProfileCard.css) for styles\n- :mag: [Custom stylelint config for React Native CSS modules](https://github.com/kristerkari/stylelint-config-react-native-css-modules)\n\n#### React Native specific\n\n- :package: Uses [React Native CSS modules](https://github.com/kristerkari/react-native-css-modules)\n- :globe_with_meridians: [Platform specific file extensions](https://facebook.github.io/react-native/docs/platform-specific-code.html#platform-specific-extensions), e.g. `styles.ios.css`, `styles.android.css`, `styles.native.css`.\n\n#### Web specific\n\n- :package: Uses [Webpack](https://webpack.js.org/) + [CSS modules](https://github.com/css-modules/css-modules).\n- :wrench: Uses [React Native for Web](https://github.com/necolas/react-native-web) to make most React Native elements work in the browser.\n\n## Supported Browsers\n\n- Mobile: Android Stock browser (4.4-5.x), Android Chrome, iOS Safari 8+\n- Desktop: Firefox, Chrome, Safari\n\n## Try it\n\n### Step 1: Install depencies to run React Native\n\nMake sure that you have `react-native-cli` installed (`npm install -g react-native-cli`) and [XCode](https://developer.apple.com/xcode/) (for iOS development) / [Android Studio](https://developer.android.com/studio/index.html) (for Android development) installed and working.\n\n- Go to \"Building Projects with Native Code\" tab and follow the guide: https://facebook.github.io/react-native/docs/getting-started.html\n\n### Step 2: Clone the repo and move to project\n\n```sh\ngit clone git@github.com:kristerkari/react-native-css-modules-example.git\ncd react-native-css-modules-example\n```\n\n### Step 3: Install example app's dependencies\n\nNodeJS packages:\n\n```sh\nyarn install\n```\n\nand CocoaPods for iOS:\n\n```sh\ncd ios \u0026\u0026 pod install\n```\n\n### Step 4: Run React Native packager\n\nYou can open a new terminal tab to run React Native's packager.\n\n```sh\nyarn start\n```\n\n### Step 5: Run app on Android, iOS or Web\n\nFirst make sure that your Android emulator or iOS simulator is working, then:\n\n```sh\nyarn ios\n```\n\nor\n\n```sh\nyarn android\n```\n\nor\n\n```sh\nyarn web\n```\n\nWeb app can be accessed by opening `http://localhost:8080` in a browser.\n\n## Screenshots\n\n**iOS - Android - Web**\n\n\u003cimg src=\"screenshots/ios.png\" width=\"33.3333%\"\u003e\u003cimg src=\"screenshots/android.png\" width=\"33.3333%\"\u003e\u003cimg src=\"screenshots/web3.png\" width=\"33.3333%\"\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristerkari%2Freact-native-css-modules-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-example/lists"}