{"id":16809538,"url":"https://github.com/shahen94/react-native-switch","last_synced_at":"2025-04-08T11:08:07.692Z","repository":{"id":12541386,"uuid":"71934450","full_name":"shahen94/react-native-switch","owner":"shahen94","description":"Customisable switch component for RN","archived":false,"fork":false,"pushed_at":"2023-04-17T15:25:18.000Z","size":74,"stargazers_count":297,"open_issues_count":37,"forks_count":172,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T11:51:12.855Z","etag":null,"topics":["react","react-native","switch"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/shahen94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2016-10-25T20:06:05.000Z","updated_at":"2025-03-12T17:09:42.000Z","dependencies_parsed_at":"2024-06-18T12:35:43.371Z","dependency_job_id":"f169256d-09f9-49dd-9899-0e3f2b63f489","html_url":"https://github.com/shahen94/react-native-switch","commit_stats":{"total_commits":67,"total_committers":29,"mean_commits":2.310344827586207,"dds":0.7761194029850746,"last_synced_commit":"454542c3e010c1ff3583d1ef5c4efdf1448d6407"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahen94%2Freact-native-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahen94%2Freact-native-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahen94%2Freact-native-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahen94%2Freact-native-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahen94","download_url":"https://codeload.github.com/shahen94/react-native-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261594,"owners_count":20910108,"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":["react","react-native","switch"],"created_at":"2024-10-13T10:13:10.594Z","updated_at":"2025-04-08T11:08:07.653Z","avatar_url":"https://github.com/shahen94.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/FnENSxi"],"categories":[],"sub_categories":[],"readme":"# react-native-switch\nCustomisable switch component for RN and React Native Web\n\n### Installation\n\n```sh\n$ npm install --save react-native-switch\n```\nor\n\n```sh\nyarn add react-native-switch\n```\n\n### Usage\n\n```javascript\nimport { Switch } from 'react-native-switch';\n\nexport const App = () =\u003e (\n  \u003cSwitch\n    value={true}\n    onValueChange={(val) =\u003e console.log(val)}\n    disabled={false}\n    activeText={'On'}\n    inActiveText={'Off'}\n    circleSize={30}\n    barHeight={1}\n    circleBorderWidth={3}\n    backgroundActive={'green'}\n    backgroundInactive={'gray'}\n    circleActiveColor={'#30a566'}\n    circleInActiveColor={'#000000'}\n    renderInsideCircle={() =\u003e \u003cCustomComponent /\u003e} // custom component to render inside the Switch circle (Text, Image, etc.)\n    changeValueImmediately={true} // if rendering inside circle, change state immediately or wait for animation to complete\n    innerCircleStyle={{ alignItems: \"center\", justifyContent: \"center\" }} // style for inner animated circle for what you (may) be rendering inside the circle\n    outerCircleStyle={{}} // style for outer animated circle\n    renderActiveText={false}\n    renderInActiveText={false}\n    switchLeftPx={2} // denominator for logic when sliding to TRUE position. Higher number = more space from RIGHT of the circle to END of the slider\n    switchRightPx={2} // denominator for logic when sliding to FALSE position. Higher number = more space from LEFT of the circle to BEGINNING of the slider\n    switchWidthMultiplier={2} // multiplied by the `circleSize` prop to calculate total width of the Switch\n    switchBorderRadius={30} // Sets the border Radius of the switch slider. If unset, it remains the circleSize.\n  /\u003e\n)\n```\n### Switch\n![switch](https://cloud.githubusercontent.com/assets/13334788/19770557/c1d935ee-9c70-11e6-931e-8812fbe62774.gif)\n\n\n##\nIf this project was helpful to you, please \u003chtml\u003e\n \u003ca href=\"https://www.buymeacoffee.com/FnENSxi\" target=\"_blank\"\u003e\u003cimg src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/yellow_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n \u003c/html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahen94%2Freact-native-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahen94%2Freact-native-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahen94%2Freact-native-switch/lists"}