{"id":17963421,"url":"https://github.com/kristerkari/react-native-css-modules-with-typescript-example","last_synced_at":"2025-03-25T05:32:17.170Z","repository":{"id":38961033,"uuid":"122785046","full_name":"kristerkari/react-native-css-modules-with-typescript-example","owner":"kristerkari","description":"A simple example app that shows how you can use CSS modules + Typescript with React Native and React (for browser)","archived":false,"fork":false,"pushed_at":"2023-07-16T13:05:47.000Z","size":8281,"stargazers_count":18,"open_issues_count":16,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-19T09:14:14.467Z","etag":null,"topics":["css","css-modules","demo-app","example","react-native","sass","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"Java","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-02-24T22:21:55.000Z","updated_at":"2024-05-18T17:00:10.000Z","dependencies_parsed_at":"2024-10-29T12:02:46.485Z","dependency_job_id":null,"html_url":"https://github.com/kristerkari/react-native-css-modules-with-typescript-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-typescript-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-typescript-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-typescript-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-css-modules-with-typescript-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-typescript-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407610,"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","ts","typescript"],"created_at":"2024-10-29T11:36:39.420Z","updated_at":"2025-03-25T05:32:16.672Z","avatar_url":"https://github.com/kristerkari.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native + CSS modules + Typescript\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 + Typescript 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\u003cimg src=\"images/plus.svg\" width=\"100\"\u003e\u003ca href=\"https://www.typescriptlang.org/\"\u003e\u003cimg src=\"images/typescript-logo.svg\" width=\"170\"\u003e\u003c/a\u003e\n\n## Example App features\n\n#### React Native and Web\n\n- :package: Automatically generates Typescript typings (`.d.ts` files) for CSS and Sass files using [react-native-typed-css-transformer](https://github.com/kristerkari/react-native-typed-css-transformer), [react-native-typed-sass-transformer\n  ](https://github.com/kristerkari/react-native-typed-sass-transformer) and Webpack's [typings-for-css-modules-loader](https://github.com/Jimdo/typings-for-css-modules-loader).\n- :package: [Uses custom Typescript `@types/react-native` package with support for className property](https://github.com/kristerkari/react-native-types-for-css-modules).\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-with-typescript-example.git\ncd react-native-css-modules-with-typescript-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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-typescript-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-typescript-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-css-modules-with-typescript-example/lists"}