{"id":13475593,"url":"https://github.com/yujonglee/react-native-switch-toggle","last_synced_at":"2025-07-24T12:34:42.582Z","repository":{"id":38852026,"uuid":"119231140","full_name":"yujonglee/react-native-switch-toggle","owner":"yujonglee","description":"react-native switch toggle button component.","archived":false,"fork":false,"pushed_at":"2024-12-20T22:33:46.000Z","size":346,"stargazers_count":128,"open_issues_count":13,"forks_count":27,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T13:49:04.699Z","etag":null,"topics":["react-native"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yujonglee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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-28T05:35:19.000Z","updated_at":"2024-12-20T22:33:51.000Z","dependencies_parsed_at":"2025-01-27T18:44:41.351Z","dependency_job_id":"7a1b9589-fd08-4470-8dd3-7118a0f60dda","html_url":"https://github.com/yujonglee/react-native-switch-toggle","commit_stats":null,"previous_names":["dooboolab/react-native-switch-toggle","yujonglee/react-native-switch-toggle","yujong-lee/react-native-switch-toggle"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yujonglee/react-native-switch-toggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujonglee%2Freact-native-switch-toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujonglee%2Freact-native-switch-toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujonglee%2Freact-native-switch-toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujonglee%2Freact-native-switch-toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujonglee","download_url":"https://codeload.github.com/yujonglee/react-native-switch-toggle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujonglee%2Freact-native-switch-toggle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266315503,"owners_count":23909786,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["react-native"],"created_at":"2024-07-31T16:01:21.754Z","updated_at":"2025-07-24T12:34:42.555Z","avatar_url":"https://github.com/yujonglee.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-native-switch-toggle\n\n\u003e Simple switch toggle component for react-native. This component supports horizontal switch toggle with animation with several options like start/end background colors, start/end circle colors, and duration for animation.\n\n[![Npm Version](http://img.shields.io/npm/v/react-native-switch-toggle.svg?style=flat-square)](https://npmjs.org/package/react-native-switch-toggle)\n[![Downloads](http://img.shields.io/npm/dm/react-native-switch-toggle.svg?style=flat-square)](https://npmjs.org/package/react-native-switch-toggle)\n[![CI](https://github.com/hyochan/react-native-switch-toggle/actions/workflows/ci.yml/badge.svg)](https://github.com/hyochan/react-native-switch-toggle/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/hyochan/react-native-switch-toggle/branch/master/graph/badge.svg?token=yLFcpGSuku)](https://codecov.io/gh/hyochan/react-native-switch-toggle)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![LICENSE](http://img.shields.io/npm/l/react-native-switch-toggle.svg?style=flat-square)](https://npmjs.org/package/react-native-switch-toggle)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)\n[![supports iOS](https://img.shields.io/badge/iOS-4630EB.svg?style=flat-square\u0026logo=APPLE\u0026labelColor=999999\u0026logoColor=fff)](https://itunes.apple.com/app/apple-store/id982107779)\n[![supports Android](https://img.shields.io/badge/Android-4630EB.svg?style=flat-square\u0026logo=ANDROID\u0026labelColor=A4C639\u0026logoColor=fff)](https://play.google.com/store/apps/details?id=host.exp.exponent\u0026referrer=www)\n[![supports web](https://img.shields.io/badge/web-4630EB.svg?style=flat-square\u0026logo=GOOGLE-CHROME\u0026labelColor=4285F4\u0026logoColor=fff)](https://docs.expo.io/workflow/web/)\n[![runs with expo](https://img.shields.io/badge/Runs%20with%20Expo-000.svg?style=flat\u0026logo=EXPO\u0026labelColor=ffffff\u0026logoColor=000)](https://github.com/expo/expo)\n\n\n\u003cimg src=\"https://user-images.githubusercontent.com/27461460/120913849-32f23580-c6d5-11eb-90bc-be0a97125427.gif\" height=400 /\u003e\n\n## News\n\nCurrent package is fully redesigned in `2.0.0`. We recommend you to use this package version `\u003e=2.0.0`.\n\n## Alternative\n\nDo you enjoy using `react-native-switch-toggle`? Then think about using [dooboo-ui](https://github.com/dooboolab/dooboo-ui) which is our ui integrated ilbrary. It included `SwitchToggle` from `0.1.6`.\n\n```\nyarn add doobo-ui\n```\n\n## Props\n\n|                      | necessary | types   | default                                                  |\n| -------------------- | --------- | ------- | -------------------------------------------------------- |\n| switchOn             | ✓         | boolean | false                                                    |\n| onPress              | ✓         | func    | () =\u003e {}                                                 |\n| containerStyle       |           | styles  | { width: 80, height: 40, borderRadius: 25 ... }          |\n| circleStyle          |           | styles  | { width: 32, height: 32, borderRadius: 16 ... }          |\n| backgroundColorOn    |           | string  | 'black'   |\n| backgroundColorOff   |           | string  | '#C4C4C4' |\n| circleColorOn        |           | string  | 'white'   |\n| circleColorOff       |           | string  | '#C4C4C4' |\n| duration             |           | number  | 300       |\n| type                 |           | number  | 0 - Normal switch, 1 - Switch with a text                |\n| buttonText           |           | string  | Text on-top of the button                                |\n| backTextRight        |           | string  | Text to appear in right side when button toggled to left |\n| backTextLeft         |           | string  | Text to appear in left side when button toggled to right |\n| buttonTextStyle      |           | styles  | Styles for text on the button                            |\n| textRightStyle       |           | styles  | Styles for text in right                                 |\n| textLeftStyle        |           | styles  | Styles for text in left                                  |\n| buttonStyle          |           | styles  | Styles for the button                                    |\n| buttonContainerStyle |           | styles  | Styles for button container                              |\n| rightContainerStyle  |           | styles  | Styles for right text container                          |\n| leftContainerStyle   |           | styles  | Styles for left text container                           |\n\n## Getting started\n\n`$ npm install react-native-switch-toggle --save`\n\n```javascript\nimport SwitchToggle from \"react-native-switch-toggle\";\n```\n\n#### Basic Style\n```jsx\n\u003cSwitchToggle switchOn={on} onPress={() =\u003e off(!on)} /\u003e\n```\n\n#### Custom Color\n```jsx\n\u003cSwitchToggle\n  switchOn={on}\n  onPress={() =\u003e off(!on)}\n  circleColorOff='#C4C4C4'\n  circleColorOn='#00D9D5'\n  backgroundColorOn='#6D6D6D'\n  backgroundColorOff='#C4C4C4'\n/\u003e\n```\n\n### Custom Size\n```jsx\n\u003cSwitchToggle\n  switchOn={on}\n  onPress={() =\u003e off(!on)}\n  containerStyle={{\n    marginTop: 16,\n    width: 106,\n    height: 48,\n    borderRadius: 25,\n    padding: 5,\n  }}\n  circleStyle={{\n    width: 40,\n    height: 40,\n    borderRadius: 20,\n  }}\n/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujonglee%2Freact-native-switch-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujonglee%2Freact-native-switch-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujonglee%2Freact-native-switch-toggle/lists"}