{"id":4058,"url":"https://github.com/kirankalyan5/react-native-segmented-control-tab","last_synced_at":"2025-05-14T04:07:50.841Z","repository":{"id":37251593,"uuid":"69211470","full_name":"kirankalyan5/react-native-segmented-control-tab","owner":"kirankalyan5","description":"react-native-segmented-control-tab(for Android/iOS)","archived":false,"fork":false,"pushed_at":"2025-05-02T08:14:16.000Z","size":2427,"stargazers_count":619,"open_issues_count":6,"forks_count":116,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-02T09:27:01.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/kirankalyan5.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,"zenodo":null}},"created_at":"2016-09-26T04:01:22.000Z","updated_at":"2025-05-01T23:33:15.000Z","dependencies_parsed_at":"2023-02-08T14:15:30.971Z","dependency_job_id":"716b1e71-a965-4095-ac0a-8d40fbe7479f","html_url":"https://github.com/kirankalyan5/react-native-segmented-control-tab","commit_stats":{"total_commits":147,"total_committers":30,"mean_commits":4.9,"dds":0.6394557823129252,"last_synced_commit":"42bfe4cfd5cc2271efb1b9d84cef0873b6628721"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirankalyan5%2Freact-native-segmented-control-tab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirankalyan5%2Freact-native-segmented-control-tab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirankalyan5%2Freact-native-segmented-control-tab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirankalyan5%2Freact-native-segmented-control-tab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirankalyan5","download_url":"https://codeload.github.com/kirankalyan5/react-native-segmented-control-tab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253214592,"owners_count":21872503,"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":[],"created_at":"2024-01-05T20:16:59.804Z","updated_at":"2025-05-14T04:07:50.812Z","avatar_url":"https://github.com/kirankalyan5.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript","Others"],"sub_categories":["UI"],"readme":"# react-native-segmented-control-tab(for Android/iOS) 🚀\n\n[![npm](https://img.shields.io/npm/v/react-native-segmented-control-tab.svg?style=flat-square \"npm version\")](https://www.npmjs.com/package/react-native-segmented-control-tab)\n[![Build Status](https://travis-ci.com/kirankalyan5/react-native-segmented-control-tab.svg?branch=master)](https://travis-ci.com/kirankalyan5/react-native-segmented-control-tab)\n[![Monthly Downloads](https://img.shields.io/npm/dm/react-native-segmented-control-tab.svg?style=flat-square)](https://npmjs.org/package/react-native-segmented-control-tab)\n[![GitHub stars](https://img.shields.io/github/stars/kirankalyan5/react-native-segmented-control-tab.svg?style=flat)](https://npmjs.org/package/react-native-segmented-control-tab)\n[ ![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square)](https://github.com/kirankalyan5/react-native-segmented-control-tab/pulls)\n\n[![NPM](https://nodei.co/npm/react-native-segmented-control-tab.png?compact=true)](https://npmjs.org/package/react-native-segmented-control-tab)\n\nA react native component with the same concept of react native's SegmantedControlIOS, Primarily built to support both IOS and Android. 💡\n\n## ScreenShots\n\n### Android\n\n![Demo](https://github.com/kirankalyan5/react-native-segmented-control-tab/blob/master/Sample/screenshots/screenshot_android.png)\n\n### iOS\n\n![Demo](https://github.com/kirankalyan5/react-native-segmented-control-tab/blob/master/Sample/screenshots/screenshot_ios.png)\n\n## Install\n\n```shell\nnpm install react-native-segmented-control-tab --save\n```\n\n## Usage\n\n### IMPORTANT\n\nThis has been made into a controlled component from 3.0. Those who are familiar with 2.0, read below for the updated usage.\n\n```javascript\nimport SegmentedControlTab from \"react-native-segmented-control-tab\";\n\nclass ConsumerComponent extends Component {\n  constructor() {\n    super();\n    this.state = {\n      selectedIndex: 0\n    };\n  }\n\n  handleIndexChange = index =\u003e {\n    this.setState({\n      ...this.state,\n      selectedIndex: index\n    });\n  };\n\n  render() {\n    return (\n      \u003cView\u003e\n        \u003cSegmentedControlTab\n          values={[\"First\", \"Second\", \"Third\"]}\n          selectedIndex={this.state.selectedIndex}\n          onTabPress={this.handleIndexChange}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n## Props\n\n| Name                         | Description                                                                                                                                 | Default                                     | Type                      |\n| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------- |\n| values                       | titles of tabs                                                                                                                              | `['One', 'Two', 'Three']`                   | array                     |\n| selectedIndex                | index of tab item to be selected initially                                                                                                  | [0]                                         | number                    |\n| selectedIndices              | Array of indices of tab items to be selected initially - when multiple prop is true else it will take selectedIndex                         | [0]                                         | arrayOf(PropTypes.number) |\n| enabled                      | Boolean to enable or disable the component                                                                                                  | true                                        | bool                      |\n| multiple                     | Boolean which enables the multiple selection option                                                                                         | false                                       | bool                      |\n| borderRadius                 | borderRadius of whole tab                                                                                                                   | 5                                           | number                    |\n| tabsContainerStyle           | external styles can be passed to override the default styles of the segmentedControl wrapper                                                | base styles added in SegmentedControlTab.js | object(styles)            |\n| tabsContainerDisableStyle    | Custom style that can be passed when `enable` is set to false                                                                               | default style `opacity: 0.6`                | object(styles)            |\n| tabStyle                     | external styles can be passed to override the default styles of the tabs                                                                    | base styles added in SegmentedControlTab.js | object(styles)            |\n| firstTabStyle                | external styles can be passed to override the default styles of the first tab                                                               | base styles added in SegmentedControlTab.js | object(styles)            |\n| lastTabStyle                 | external styles can be passed to override the default styles of the last tab                                                                | base styles added in SegmentedControlTab.js | object(styles)            |\n| tabTextStyle                 | external styles can be passed to override the default styles of the tab title                                                               | base styles added in SegmentedControlTab.js | object(styles)            |\n| activeTabStyle               | external styles can be passed to override the default styles of the active tab                                                              | base styles added in SegmentedControlTab.js | object(styles)            |\n| activeTabTextStyle           | external styles can be passed to override the default styles of the active tab text                                                         | base styles added in SegmentedControlTab.js | object(styles)            |\n| badges                       | badges values to display                                                                                                                    | `[1, 2, 3]`                                 | array                     |\n| tabBadgeContainerStyle       | external style can be passed to override the default style of the badge container                                                           | base styles added in SegmentedControlTab.js | object(styles)            |\n| activeTabBadgeContainerStyle | external style can be passed to override the default style of the active badge container                                                    | base styles added in SegmentedControlTab.js | object(styles)            |\n| tabBadgeStyle                | external style can be passed to override the default style of the badge text                                                                | base styles added in SegmentedControlTab.js | object(styles)            |\n| activeTabBadgeStyle          | external style can be passed to override the default style of the active badge text                                                         | base styles added in SegmentedControlTab.js | object(styles)            |\n| onTabPress                   | call-back function when a tab is selected                                                                                                   | () =\u003e {}                                    | func                      |\n| allowFontScaling             | whether the segment \u0026 badge text should allow font scaling (default matches React Native default)                                           | true                                        | bool                      |\n| accessible                   | enables accessibility for each tab                                                                                                          | true                                        | bool                      |\n| accessibilityLabels          | Reads out the given text on each tab press when voice over is enabled. If not set, uses the text passed in as values in props as a fallback | ['Label 1', 'Label 2', 'Label 3']           | array                     |\n| activeTabOpacity             | Opacity value to customize tab press                                                                                                        | 1                                           | number                    |\n\n## Custom styling\n\n```javascript\n\u003cSegmentedControlTab\n  tabsContainerStyle={styles.tabsContainerStyle}\n  tabStyle={styles.tabStyle}\n  firstTabStyle={styles.firstTabStyle}\n  lastTabStyle={styles.lastTabStyle}\n  tabTextStyle={styles.tabTextStyle}\n  activeTabStyle={styles.activeTabStyle}\n  activeTabTextStyle={styles.activeTabTextStyle}\n  selectedIndex={1}\n  allowFontScaling={false}\n  values={[\"First\", \"Second\", \"Third\"]}\n  onTabPress={index =\u003e this.setState({ selected: index })}\n/\u003e;\n\nconst styles = StyleSheet.create({\n  tabsContainerStyle: {\n    //custom styles\n  },\n  tabStyle: {\n    //custom styles\n  },\n  firstTabStyle: {\n    //custom styles\n  },\n  lastTabStyle: {\n    //custom styles\n  },\n  tabTextStyle: {\n    //custom styles\n  },\n  activeTabStyle: {\n    //custom styles\n  },\n  activeTabTextStyle: {\n    //custom styles\n  },\n  tabBadgeContainerStyle: {\n    //custom styles\n  },\n  activeTabBadgeContainerStyle: {\n    //custom styles\n  },\n  tabBadgeStyle: {\n    //custom styles\n  },\n  activeTabBadgeStyle: {\n    //custom styles\n  }\n});\n```\n\n## P.S.\n\n🙏 credits to all the other devs who had built the similar concept, had referred some of the their components on the github, to get a fair idea 💡 to build this.😊\nIf you have any idea in implementing this further, let me know or you can update it and raise a PR.😊🚀\n\n## License\n\n_MIT_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirankalyan5%2Freact-native-segmented-control-tab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirankalyan5%2Freact-native-segmented-control-tab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirankalyan5%2Freact-native-segmented-control-tab/lists"}