{"id":13637484,"url":"https://github.com/recr0ns/react-native-material-switch","last_synced_at":"2025-04-19T08:34:15.146Z","repository":{"id":46934129,"uuid":"43875265","full_name":"recr0ns/react-native-material-switch","owner":"recr0ns","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-24T22:47:02.000Z","size":579,"stargazers_count":79,"open_issues_count":35,"forks_count":83,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-29T15:06:12.572Z","etag":null,"topics":["javascript","react-native"],"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/recr0ns.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}},"created_at":"2015-10-08T08:53:35.000Z","updated_at":"2022-05-27T03:58:07.000Z","dependencies_parsed_at":"2023-02-14T02:16:31.120Z","dependency_job_id":null,"html_url":"https://github.com/recr0ns/react-native-material-switch","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/recr0ns%2Freact-native-material-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recr0ns%2Freact-native-material-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recr0ns%2Freact-native-material-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recr0ns%2Freact-native-material-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recr0ns","download_url":"https://codeload.github.com/recr0ns/react-native-material-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249650618,"owners_count":21306037,"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":["javascript","react-native"],"created_at":"2024-08-02T00:01:18.223Z","updated_at":"2025-04-19T08:34:14.831Z","avatar_url":"https://github.com/recr0ns.png","language":"JavaScript","funding_links":[],"categories":["React Native"],"sub_categories":["Components React Native"],"readme":"## Customizable material switch for react-native\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"http://oi57.tinypic.com/2rysl94.jpg\" /\u003e\n\u003c/p\u003e\n\n### Content\n- [Installation](#installation)\n- [Usage example](#usage-example)\n- [Properties](#properties)\n- [Events](#events)\n- [Live example](#live-example)\n- [Questions?](#questions)\n\n### Installation\n```bash\nnpm install react-native-material-switch\n```\n\n### Usage example\n```javascript\nvar Switch = require('react-native-material-switch');\n\nvar Application = React.createClass({\n  render: function() {\n    return (\n      \u003cView\u003e\n        \u003cSwitch onChangeState={(state)=\u003e{alert(state)}}/\u003e\n      \u003c/View\u003e\n    );\n  }\n});\n```\n\n### Properties\n* `active` (Boolean) - Initial switch state (default: false),\n* `style` (Object) - Styles for outer container (margins, ...),\n* `inactiveButtonColor` (String) - Button color  (default: '#2196F3'),\n* `inactiveButtonPressedColor` (String) (default: '#42A5F5'),\n* `activeButtonColor` (String) (default: '#FAFAFA'),\n* `activeButtonPressedColor` (String) (default: '#F5F5F5'),\n* `buttonShadow` (Object) - Shadow style for button (default: { shadowColor: '#000', shadowOpacity: 0.5, shadowRadius: 1, shadowOffset: { height: 1, width: 0 }},\n* `activeBackgroundColor` (String) - (default: 'rgba(255,255,255,.5)'),\n* `inactiveBackgroundColor` (String) - (default: 'rgba(0,0,0,.5)'),\n* `buttonRadius` (Number) - (default: 15),\n* `switchWidth` (Number) - (default: 40),\n* `switchHeight` (Number) - (default: 20),\n* `buttonContent` (React.Component) - Custom inline content for switch button (default: null),\n* `enableSlide` (Boolean) - (default: true),\n* `enableSlideDragging` - (default: true) - Allows to change the position of the toggle by sliding. Does not work in react-native-web. If disabled, you can only toggle by pressing,\n* `switchAnimationTime` (Number) - Switch animation duration (default: 200),\n\n### Events\n* `onActivate`: This function is called when the switch is activated.\n* `onDeactivate`: This function is called when the switch is deactivated.\n* `onChangeState`: Sends the current state of switch.\n\n### Live example\n```sh\ngit clone git@github.com:Recr0ns/react-native-material-switch.git\ncd react-native-material-switch/examples\nnpm install\nopen ios/switchExample.xcodeproj\n```\nThen `Cmd+R` to start the React Packager, build and run the project in the simulator.\n\n### License\nMIT License\n\n### Questions?\nFeel free to [create an issue](https://github.com/Recr0ns/react-native-material-switch/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecr0ns%2Freact-native-material-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecr0ns%2Freact-native-material-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecr0ns%2Freact-native-material-switch/lists"}