{"id":17700836,"url":"https://github.com/wrathchaos/react-native-segmented-control-2","last_synced_at":"2025-09-23T01:30:58.118Z","repository":{"id":65345136,"uuid":"500117703","full_name":"WrathChaos/react-native-segmented-control-2","owner":"WrathChaos","description":"🚀 React Native Segmented Control, Pure Javascript for iOS and Android","archived":false,"fork":false,"pushed_at":"2025-09-08T14:49:19.000Z","size":5879,"stargazers_count":52,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-08T15:19:13.890Z","etag":null,"topics":["android","app-dev","app-development","apple","application","development","freakycoder","google","ios","javascript","kuray","mobile","react","react-native","reactjs","segment","segmented-control","typescript"],"latest_commit_sha":null,"homepage":"https://freakycoder.com","language":"TypeScript","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-05T14:18:21.000Z","updated_at":"2025-09-08T14:49:12.000Z","dependencies_parsed_at":"2024-10-24T21:24:42.487Z","dependency_job_id":"c8c1a0f5-abaf-461b-8216-bf3b7e561c9d","html_url":"https://github.com/WrathChaos/react-native-segmented-control-2","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.3125,"last_synced_commit":"de690ac72ae0352ab690386eddb23c605dec8bd8"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"WrathChaos/react-native-typescript-library-starter","purl":"pkg:github/WrathChaos/react-native-segmented-control-2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-segmented-control-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-segmented-control-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-segmented-control-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-segmented-control-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WrathChaos","download_url":"https://codeload.github.com/WrathChaos/react-native-segmented-control-2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-segmented-control-2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276502707,"owners_count":25653732,"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-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["android","app-dev","app-development","apple","application","development","freakycoder","google","ios","javascript","kuray","mobile","react","react-native","reactjs","segment","segmented-control","typescript"],"created_at":"2024-10-24T17:43:22.405Z","updated_at":"2025-09-23T01:30:58.112Z","avatar_url":"https://github.com/WrathChaos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"React Native Segmented Control 2\" src=\"assets/logo.png\" width=\"1050\"/\u003e\n\n[![React Native Segmented Control 2](https://img.shields.io/badge/-%F0%9F%9A%80%20React%20Native%20Segmented%20Control%2C%20Pure%20Javascript%20for%20iOS%20and%20Android-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-segmented-control-2)\n\n[![npm version](https://img.shields.io/npm/v/react-native-segmented-control-2.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-segmented-control-2)\n[![npm](https://img.shields.io/npm/dt/react-native-segmented-control-2.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-segmented-control-2)\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 Segmented Control 2\"\n        src=\"assets/Screenshots/react-native-segmented-control-2.gif\" height=\"950\" width=\"465\" /\u003e\n\u003c/p\u003e\n\n# Installation\n\nAdd the dependency:\n\n```bash\nnpm i react-native-segmented-control-2\n```\n\n## Peer Dependencies\n\n\u003cb\u003e\u003ci\u003eZero Dependency\u003c/i\u003e\u003c/b\u003e 🥳\n\n# Usage\n\n## Import\n\n```jsx\nimport SegmentedControl from \"react-native-segmented-control-2\";\n```\n\n## Fundamental Usage\n\n```jsx\n\u003cSegmentedControl\n  tabs={[\"Label 1\", \"Label 2\", \"Label 3\"]}\n  onChange={(index: number) =\u003e console.log(\"Index: \", index)}\n/\u003e\n```\n\nAs controlled component:\n\n```jsx\nconst [index, setIndex] = useState(0)\nreturn (\n  \u003cSegmentedControl\n    tabs={[\"Label 1\", \"Label 2\", \"Label 3\"]}\n    onChange={setIndex}\n    value={index}\n  /\u003e\n)\n```\n\n## Customized Usage\n\n```jsx\n\u003cSegmentedControl\n  style={{ marginTop: 32, backgroundColor: \"#ffe0e0\" }}\n  activeTabColor=\"#ff2929\"\n  activeTextColor=\"#fff\"\n  tabs={[\"Label 1\", \"Label 2\", \"Label 3\"]}\n  onChange={(index: number) =\u003e console.log(\"Index: \", index)}\n/\u003e\n```\n\n### Any Component Usage\n\nYou can use the segmented control with any component.\nAll you need to do is that put any component into the `tabs` props.\nPlease check out the `example` for its usage\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| tabs     |  any[]   | undefined | set the array for tabs                               |\n| onChange | function | undefined | set your own logic when the tab is pressed / changed |\n| value    | number   | undefined | value of index if used as a controlled component     |\n\n## Customization (Optionals)\n\n| Property         |   Type    | Default | Description                                                |\n|------------------|:---------:|:-------:|------------------------------------------------------------|\n| style            | ViewStyle | default | set or override the style object for the main container    |\n| initialIndex     |  number   |    0    | set the initial index                                      |\n| activeTextColor  |  string   |  #000   | change the active tab's text color                         |\n| activeTabColor   |  string   |  #FFF   | change the active tab's color                              |\n| gap              |  number   |    0    | set extra spacing for animation horizontal value           |\n| tabStyle         | ViewStyle | default | set or override the style object for the tab               |\n| selectedTabStyle | ViewStyle | default | set or override the style object for the selected tab      |\n| activeTextStyle  | TextStyle | default | set or override the style object for the active tab's text |\n| textStyle        | TextStyle | default | set or override the style object for tab's text            |\n\n## Future Plans\n\n- [x] ~~LICENSE~~\n- [x] ~~Controller component support~~ (Thanks to @madox2 (https://github.com/WrathChaos/react-native-segmented-control-2/pull/6))\n- [x] ~~Getting rid of screen width and manual width dependencies~~ (Thanks to @philo23 (https://github.com/WrathChaos/react-native-segmented-control-2/pull/7)\n- [ ] Write an article about the lib on Medium\n\n## Credits\n\nHeavily inspired by these libraries:\n\n- [react-native-segmented-control/segmented-control](https://github.com/react-native-segmented-control/segmented-control)\n- [Karthik-B-06/react-native-segmented-control](https://github.com/Karthik-B-06/react-native-segmented-control)\n\nI created this library because they're really not maintain actively and this is a pure javascript written library with a lot of customizations and better code structure\n\n## Author\n\nFreakyCoder, kurayogun@gmail.com\n\n## License\n\nReact Native Segmented Control 2 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-segmented-control-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrathchaos%2Freact-native-segmented-control-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrathchaos%2Freact-native-segmented-control-2/lists"}