{"id":17700784,"url":"https://github.com/wrathchaos/react-native-toggle-button","last_synced_at":"2025-04-23T22:28:39.475Z","repository":{"id":57340941,"uuid":"430423944","full_name":"WrathChaos/react-native-toggle-button","owner":"WrathChaos","description":"Cool and easy to use react native toggle button","archived":false,"fork":false,"pushed_at":"2021-11-26T16:45:26.000Z","size":1518,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T06:37:29.703Z","etag":null,"topics":["android","apple","button","front-end","google","ios","javascript","mobile","programming","react","react-native","reactjs","toggle","toggle-button","toggle-switches","typescript","ui","ux"],"latest_commit_sha":null,"homepage":"https://freakycoder.com","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/WrathChaos.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}},"created_at":"2021-11-21T16:46:51.000Z","updated_at":"2023-05-12T17:06:05.000Z","dependencies_parsed_at":"2022-09-08T18:40:28.146Z","dependency_job_id":null,"html_url":"https://github.com/WrathChaos/react-native-toggle-button","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"WrathChaos/react-native-typescript-library-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-toggle-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-toggle-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-toggle-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-toggle-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WrathChaos","download_url":"https://codeload.github.com/WrathChaos/react-native-toggle-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250525756,"owners_count":21445073,"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":["android","apple","button","front-end","google","ios","javascript","mobile","programming","react","react-native","reactjs","toggle","toggle-button","toggle-switches","typescript","ui","ux"],"created_at":"2024-10-24T17:43:06.603Z","updated_at":"2025-04-23T22:28:39.458Z","avatar_url":"https://github.com/WrathChaos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"React Native Toggle Button\" src=\"assets/logo.png\" width=\"1050\"/\u003e\n\n[![React Native Toggle Button](https://img.shields.io/badge/-Cool%20and%20easy%20to%20use%20react%20native%20toggle%20button-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-toggle-button)\n\n[![npm version](https://img.shields.io/npm/v/react-native-toggle-button.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-toggle-button)\n[![npm](https://img.shields.io/npm/dt/react-native-toggle-button.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-toggle-button)\n![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-blue.svg?style=for-the-badge)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"React Native Toggle Button\"\n        src=\"assets/Screenshots/react-native-toggle-button.gif\" /\u003e\n\u003c/p\u003e\n\n# Installation\n\nAdd the dependency:\n\n```bash\nnpm i react-native-toggle-button\n```\n\n## Peer Dependencies\n\nZero Dependency\n\n# Usage\n\n## Import\n\n```jsx\nimport ToggleButton from \"react-native-toggle-button\";\n```\n\n## Fundamental Usage\n\n```jsx\n\u003cToggleButton\n  primaryText=\"On\"\n  secondaryText=\"Off\"\n  onPress={(isToggled: boolean) =\u003e {\n    console.log(isToggled);\n  }}\n/\u003e\n```\n\n## Example Project 😍\n\nYou can checkout the example project 🥰\n\nSimply run\n\n- `npm i`\n- `react-native run-ios/android`\n\nshould work of the example project.\n\n# Configuration - Props\n\n## Fundamentals\n\n| Property      |   Type   |  Default  | Description                                                        |\n| ------------- | :------: | :-------: | ------------------------------------------------------------------ |\n| primaryText   |  string  | undefined | change the primaryText                                             |\n| secondaryText |  string  | undefined | change the secondaryText                                           |\n| onPress       | function | undefined | set your own logic for the button functionality when it is pressed |\n\n## Customization (Optionals)\n\n| Property            |           Type           | Default | Description                                                                               |\n| ------------------- | :----------------------: | :-----: | ----------------------------------------------------------------------------------------- |\n| inial               |         boolean          |  true   | let you change the initial toggled value                                                  |\n| style               |        ViewStyle         | default | set or override the style object for the main container                                   |\n| activeButtonStyle   |        ViewStyle         | default | set or override the style object for the `active button` style                            |\n| inactiveButtonStyle |        ViewStyle         | default | set or override the style object for the `inactive button` style                          |\n| activeTextStyle     |        TextStyle         | default | set or override the style object for the `active text` style                              |\n| inactiveTextStyle   |        TextStyle         | default | set or override the style object for the `inactive text` style                            |\n| TouchableComponent  | TouchableWithoutFeedback | default | set your own component instead of default react-native TouchableWithoutFeedback component |\n\n## Future Plans\n\n- [x] ~~LICENSE~~\n- [ ] Write an article about the lib on Medium\n\n## Author\n\nFreakyCoder, kurayogun@gmail.com\n\n## License\n\nReact Native Toggle Button is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrathchaos%2Freact-native-toggle-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrathchaos%2Freact-native-toggle-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrathchaos%2Freact-native-toggle-button/lists"}