{"id":17963375,"url":"https://github.com/kristerkari/react-native-css-modules-with-media-queries-example","last_synced_at":"2025-03-25T05:32:17.208Z","repository":{"id":31057155,"uuid":"126743745","full_name":"kristerkari/react-native-css-modules-with-media-queries-example","owner":"kristerkari","description":"An example app to show how CSS Media Queries work in React Native.","archived":false,"fork":false,"pushed_at":"2024-09-21T11:10:45.000Z","size":8584,"stargazers_count":19,"open_issues_count":12,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-19T09:14:12.363Z","etag":null,"topics":["css","css-modules","demo-app","example","example-app","media-queries","react-native"],"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-03-25T21:57:00.000Z","updated_at":"2024-06-25T11:18:19.000Z","dependencies_parsed_at":"2024-10-29T11:50:45.529Z","dependency_job_id":null,"html_url":"https://github.com/kristerkari/react-native-css-modules-with-media-queries-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-with-media-queries-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-media-queries-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-media-queries-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-media-queries-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-with-media-queries-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407609,"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","example-app","media-queries","react-native"],"created_at":"2024-10-29T11:35:41.680Z","updated_at":"2025-03-25T05:32:16.448Z","avatar_url":"https://github.com/kristerkari.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native CSS modules with CSS Media Queries\n\n![Platform - Android, iOS and Web](https://img.shields.io/badge/platform-Android%20%7C%20iOS%20%7C%20Web-blue.svg)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\nAn example app to show how CSS Media Queries work in React Native.\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---\n\n\u003cimg src=\"screenshots/react-native-css-media-queries.gif\" width=\"600\"\u003e\n\nThis example app re-implements [\"Responsive Full Width Tabs\" demo](https://tympanus.net/Blueprints/FullWidthTabs/) from Tympanus Codrops website in React Native.\n\nThe example app should look and work exactly the same way in both browser and React Native.\n\nTo see code examples, have a look at [styles.css](/src/styles.css#L222) and [App.js](/src/App.js) inside [src](/src) folder.\n\n## Example App features\n\n#### React Native and Web\n\n- :computer: Uses the same CSS Media Queries for responsive scaling in React Native and web browsers.\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- :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-with-media-queries-example.git\ncd react-native-css-modules-with-media-queries-example\n```\n\n### Step 3: Install example app's dependencies\n\n```sh\nnpm 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\nnpm 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\nnpm run ios\n```\n\nor\n\n```sh\nnpm run android\n```\n\nor\n\n```sh\nnpm run web\n```\n\nWeb app can be accessed by opening `http://localhost:8080` in a browser.\n\n---\n\n...or if you use Yarn:\n\n```sh\nyarn ios\n```\n\n```sh\nyarn android\n```\n\n```sh\nyarn web\n```\n\n## Screenshots\n\n### iPhone 8\n\n**Left: iOS Safari browser**\u003cbr\u003e\n**Right: React Native**\n\n\u003cimg src=\"screenshots/iphone-browser-portrait.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/iphone-native-portrait.png\" width=\"50%\"\u003e\n\u003cimg src=\"screenshots/iphone-browser-landscape.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/iphone-native-landscape.png\" width=\"50%\"\u003e\n\n### iPad 5G\n\n**Left: iOS Safari browser**\u003cbr\u003e\n**Right: React Native**\n\n\u003cimg src=\"screenshots/ipad-browser-portrait.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/ipad-native-portrait.png\" width=\"50%\"\u003e\n\u003cimg src=\"screenshots/ipad-browser-landscape.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/ipad-native-landscape.png\" width=\"50%\"\u003e\n\n### Android Nexus 5X\n\n**Left: Android Chrome browser**\u003cbr\u003e\n**Right: React Native**\n\n\u003cimg src=\"screenshots/android-browser-portrait.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/android-native-portrait.png\" width=\"50%\"\u003e\n\u003cimg src=\"screenshots/android-browser-landscape.png\" width=\"50%\"\u003e\u003cimg src=\"screenshots/android-native-landscape.png\" width=\"50%\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-media-queries-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-media-queries-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-media-queries-example/lists"}