{"id":26266099,"url":"https://github.com/react-native-studio/react-native-switchbutton","last_synced_at":"2025-04-30T16:46:43.856Z","repository":{"id":57340613,"uuid":"128018712","full_name":"react-native-studio/react-native-switchbutton","owner":"react-native-studio","description":"提供IOS样式的跨平台的Switch组件","archived":false,"fork":false,"pushed_at":"2018-06-08T02:47:28.000Z","size":338,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-30T18:02:13.699Z","etag":null,"topics":["bool","button","input","switch","switch-button","switchbutton"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-native-studio.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":"2018-04-04T06:39:52.000Z","updated_at":"2023-12-12T07:41:56.000Z","dependencies_parsed_at":"2022-09-11T10:40:36.994Z","dependency_job_id":null,"html_url":"https://github.com/react-native-studio/react-native-switchbutton","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/react-native-studio%2Freact-native-switchbutton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-studio%2Freact-native-switchbutton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-studio%2Freact-native-switchbutton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-studio%2Freact-native-switchbutton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-studio","download_url":"https://codeload.github.com/react-native-studio/react-native-switchbutton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251747772,"owners_count":21637404,"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":["bool","button","input","switch","switch-button","switchbutton"],"created_at":"2025-03-14T03:16:50.337Z","updated_at":"2025-04-30T16:46:43.838Z","avatar_url":"https://github.com/react-native-studio.png","language":"JavaScript","readme":"# react-native-switchbutton[![npm version](https://badge.fury.io/js/react-native-switchbutton.svg)](https://badge.fury.io/js/react-native-switchbutton)\n一个IOS样式的跨平台（cross-platform）平台的switch组件\n## 第一步\n工程目录下运行:\u003cbr/\u003e\n` npm install --save react-native-switchbutton`\u003cbr/\u003e\n或者(已经安装了yarn):\u003cbr/\u003e` yarn add react-native-switchbutton`\n## 第二部使用\n在工程中导入：\n```js\nimport Switch from 'react-native-switchbutton';\n\n//使用方法和RN官方的Switch类似，\n\u003cSwitch/\u003e\n```\n## 属性\n```js\nView props... \n\ndisabled bool \n\n如果为true，这个组件不能进行交互。\n\nonValueChange function \n\n当值改变的时候调用此回调函数，参数为新的值。\n\nvalue bool \n\n表示此开关是否打开。默认为false（关闭状态）。\n\nonTintColor ColorPropType \n\n开启状态时的背景颜色。\n\nthumbTintColor ColorPropType \n\n开关上圆形按钮的背景颜色。\n\ntintColor ColorPropType \n\n关闭状态时的边框颜色(iOS)或背景颜色(Android)。\n\nuseNative bool\n\n使用RN官方提供的switch\n\ntintColorUsage string\n\ntintColor的使用，border和background可供选择,仅在useNative为false时有效\n\nuseNativeDriver\n\n是否使用原生动画,仅在useNative为false时有效\n```\n\n## 示例\n\u003c!--![image](https://github.com/2534290808/react-native-android-danmaku/blob/master/images/Screenshot_1513176625.png)--\u003e\n\u003cimg src=\"https://github.com/react-native-studio/react-native-switchbutton/blob/master/1.gif\" width = \"300\"  alt=\"图片名称\" align=center /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-studio%2Freact-native-switchbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-studio%2Freact-native-switchbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-studio%2Freact-native-switchbutton/lists"}