{"id":22416041,"url":"https://github.com/kiok46/react-native-triple-state-switch","last_synced_at":"2025-09-13T16:39:51.504Z","repository":{"id":57341006,"uuid":"107457476","full_name":"kiok46/react-native-triple-state-switch","owner":"kiok46","description":"React Native Triple State Switch","archived":false,"fork":false,"pushed_at":"2017-11-06T14:49:25.000Z","size":5,"stargazers_count":15,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-13T22:10:41.303Z","etag":null,"topics":["android","ios","react","react-native","switch"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-triple-state-switch","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/kiok46.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":"2017-10-18T20:09:07.000Z","updated_at":"2023-06-27T23:25:50.000Z","dependencies_parsed_at":"2022-09-08T01:50:25.281Z","dependency_job_id":null,"html_url":"https://github.com/kiok46/react-native-triple-state-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/kiok46%2Freact-native-triple-state-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiok46%2Freact-native-triple-state-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiok46%2Freact-native-triple-state-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiok46%2Freact-native-triple-state-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiok46","download_url":"https://codeload.github.com/kiok46/react-native-triple-state-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228321237,"owners_count":17901604,"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","ios","react","react-native","switch"],"created_at":"2024-12-05T15:14:28.200Z","updated_at":"2024-12-05T15:14:29.156Z","avatar_url":"https://github.com/kiok46.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-triple-state-switch\nReact Native Triple State Switch\n\n\n![events](https://user-images.githubusercontent.com/7335120/32444755-b7779f42-c329-11e7-8e08-9942ffcc4f73.gif)\n![animated](https://user-images.githubusercontent.com/7335120/32444785-cc352602-c329-11e7-98ac-55b9d20e7e02.gif)\n\n\n### Installation\n```\nnpm i react-native-triple-state-switch --save\n```\n\n### Supported Platforms\n\n`iOS` and `Android`\n\n## Usage example\n\n```\nimport TrippleToggleSwitch from './TrippleToggleSwitch';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nconst AnimatedIcon = Animated.createAnimatedComponent(Icon);\n\nexport default class App extends Component {\n\n  constructor(props) {\n      super(props)\n\n      this.state = {\n          bg: 'brown'\n      }\n  }\n\n  render() {\n    return (\n      \u003cView style={[styles.container, {backgroundColor: this.state.bg}]}\u003e\n\t    \u003cTrippleToggleSwitch\n            onLeftState={()=\u003e{this.setState({bg: 'grey'})}}\n            onMiddleState={()=\u003e{this.setState({bg: 'black'})}}\n            onRightState={()=\u003e{this.setState({bg: 'brown'})}}\n            AnimatedIcon={AnimatedIcon}\n            middleStateIconName={'instagram'}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n\n});\n```\n\n\n## API\n\n\n| Property     | Type     | Default               | Description                                                                                                |\n|--------------|----------|-----------------------|------------------------------------------------------------------------------------------------------------|\n| defaultActiveIndex      | number    | 0                    | Item index which should be active when the component renders                                                         |\n| primaryColor  | string   | #124E96               | Color of icon when in non-active state \u0026 Color of icon background when in active state                                                                                 |\n| secondaryColor      | string  | white                  | Color of icon when in active state \u0026 Color of icon background when in non-active state                                                                                   |\n| minValue      | number  | 0                  | Min Value from left                                                                                   |\n| maxValue      | number  | 115                  | Max Value from right                                                                                   |\n| leftStateiconName      | string  | facebook                  | Left Icon Name                                                                                   |\n| middleStateiconName      | string  | twitter                  | Middle Icon Name                                                                                   |\n| rightStateiconName      | string  | github                  | Right Icon Name                                                                                   |\n| stateIconSize      | number  | 30                  | Icon Size                                                                                   |\n| switchShiftTime      | number  | 200                  | Animation Timing in ms                                                                                   |\n| itemContainer      | style  | null                  | individual Icon styling                                                                                   |\n| itemsContainer      | style  | null                  | Icons container styling                                                                                   |\n| floatingPointerStyle      | style  | null                  | The draggable component's styling                                                                                   |\n| itemsContainerBackgroundStyle      | style  | null                  | Icons container's background styling.                                                                                   |\n| onLeftState      | function  | () =\u003e {}                  | Function to be called when either the left Icon is pressed or the draggable component is dragged on top of it.                                                                                   |\n| onMiddleState      | function  | () =\u003e {}                  | Function to be called when either the middle Icon is pressed or the draggable component is dragged on top of it.                                                                                   |\n| onRightState      | function  | () =\u003e {}                  | Function to be called when either the right Icon is pressed or the draggable component is dragged on top of it.                                                                                   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiok46%2Freact-native-triple-state-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiok46%2Freact-native-triple-state-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiok46%2Freact-native-triple-state-switch/lists"}