{"id":36543010,"url":"https://github.com/sramezani/switch-button-react-native","last_synced_at":"2026-01-12T05:50:00.815Z","repository":{"id":46926462,"uuid":"109127769","full_name":"sramezani/switch-button-react-native","owner":"sramezani","description":"Customisable switch button in react native ( e.g: change view after change  switch button )","archived":false,"fork":false,"pushed_at":"2020-12-25T01:30:17.000Z","size":8,"stargazers_count":28,"open_issues_count":4,"forks_count":15,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-27T10:52:50.568Z","etag":null,"topics":["react-native-switch","switch-button"],"latest_commit_sha":null,"homepage":null,"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/sramezani.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-11-01T12:19:50.000Z","updated_at":"2025-09-24T10:48:34.000Z","dependencies_parsed_at":"2022-09-23T09:00:27.728Z","dependency_job_id":null,"html_url":"https://github.com/sramezani/switch-button-react-native","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sramezani/switch-button-react-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sramezani%2Fswitch-button-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sramezani%2Fswitch-button-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sramezani%2Fswitch-button-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sramezani%2Fswitch-button-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sramezani","download_url":"https://codeload.github.com/sramezani/switch-button-react-native/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sramezani%2Fswitch-button-react-native/sbom","scorecard":{"id":843472,"data":{"date":"2025-08-11","repo":{"name":"github.com/sramezani/switch-button-react-native","commit":"257715d0382286c882e00b4decc003545bc88b2d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T20:57:39.561Z","repository_id":46926462,"created_at":"2025-08-23T20:57:39.561Z","updated_at":"2025-08-23T20:57:39.561Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["react-native-switch","switch-button"],"created_at":"2026-01-12T05:50:00.735Z","updated_at":"2026-01-12T05:50:00.810Z","avatar_url":"https://github.com/sramezani.png","language":"JavaScript","readme":"# switch-button-react-native\nCustomisable switch button in react native ( e.g: change view after change  switch button )\n\n![switchbutton](https://user-images.githubusercontent.com/33284430/32404024-3d02ba94-c15d-11e7-8e76-87276dd2ee1a.gif)\n\n\nhow to use:\n\n1) import component\n2) set\n\n        activeSwitch=1\nto state\n\n3) use:\n\n        \u003cSwitchButton  \n              onValueChange={(val) =\u003e this.setState({ activeSwitch: val })} \n        /\u003e \nin your code\n\n4) use:\n\n        { this.state.activeSwitch === 1 ? view1 : view2 }\n\n\n\n\n\nsmall example: ...\n    \n    import React, { Component } from 'react'; \n    import { View } from 'react-native'; \n    import SwitchButton from 'switch-button-react-native';\n    \n    constructor () {\n        super();\n\n        this.state = {\n          activeSwitch: 1\n        };\n    }\n\n\n    render () {\n\n        return (\n\n            \u003cView\u003e\n                \u003cSwitchButton\n                    onValueChange={(val) =\u003e this.setState({ activeSwitch: val })}      // this is necessary for this component\n                    text1 = 'ON'                        // optional: first text in switch button --- default ON\n                    text2 = 'OFF'                       // optional: second text in switch button --- default OFF\n                    switchWidth = {100}                 // optional: switch width --- default 44\n                    switchHeight = {44}                 // optional: switch height --- default 100\n                    switchdirection = 'rtl'             // optional: switch button direction ( ltr and rtl ) --- default ltr\n                    switchBorderRadius = {100}          // optional: switch border radius --- default oval\n                    switchSpeedChange = {500}           // optional: button change speed --- default 100\n                    switchBorderColor = '#d4d4d4'       // optional: switch border color --- default #d4d4d4\n                    switchBackgroundColor = '#fff'      // optional: switch background color --- default #fff\n                    btnBorderColor = '#00a4b9'          // optional: button border color --- default #00a4b9\n                    btnBackgroundColor = '#00bcd4'      // optional: button background color --- default #00bcd4\n                    fontColor = '#b1b1b1'               // optional: text font color --- default #b1b1b1\n                    activeFontColor = '#fff'            // optional: active font color --- default #fff\n                /\u003e\n                \n                { this.state.activeSwitch === 1 ? console.log('view1') : console.log('view2') }\n                \n            \u003c/View\u003e\n\n        );\n    }\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsramezani%2Fswitch-button-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsramezani%2Fswitch-button-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsramezani%2Fswitch-button-react-native/lists"}