Gathering detailed insights and metrics for react-switch-selector
Gathering detailed insights and metrics for react-switch-selector
Gathering detailed insights and metrics for react-switch-selector
Gathering detailed insights and metrics for react-switch-selector
react-native-switch-selector
Switch Selector to React Native.
react-native-switch-selector-fix
Switch Selector to React Native.
react-language-switch
Simple context-based language-differentiating display and selector components for react.
@pcgnpm/custom-switch-selector
Display custom switch selector
npm install react-switch-selector
Typescript
Module System
Node Version
NPM Version
TypeScript (92.82%)
JavaScript (4.03%)
HTML (3.14%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
11 Stars
293 Commits
5 Forks
2 Watchers
19 Branches
2 Contributors
Updated on Aug 06, 2024
Latest Version
2.3.0
Package Id
react-switch-selector@2.3.0
Unpacked Size
84.51 kB
Size
13.06 kB
File Count
18
NPM Version
10.5.0
Node Version
20.12.2
Published on
Aug 06, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
25
https://gr34se.github.io/react-switch-selector/
1npm install react-switch-selector --save
or
1yarn add react-switch-selector
SwitchSelector will stretch to fill its parent size (both width and height), so it's required create dedicated div container.
1import SwitchSelector from "react-switch-selector";
1const options = [ 2 { 3 label: <span>Foo</span>, 4 value: { 5 foo: true 6 }, 7 selectedBackgroundColor: "#0097e6", 8 }, 9 { 10 label: "Bar", 11 value: "bar", 12 selectedBackgroundColor: "#fbc531" 13 } 14]; 15 16const onChange = (newValue) => { 17 console.log(newValue); 18}; 19 20const initialSelectedIndex = options.findIndex(({value}) => value === "bar"); 21 22return ( 23 <div className="your-required-wrapper" style={{width: 100, height: 30}}> 24 <SwitchSelector 25 onChange={onChange} 26 options={options} 27 initialSelectedIndex={initialSelectedIndex} 28 backgroundColor={"#353b48"} 29 fontColor={"#f5f6fa"} 30 /> 31 </div> 32);
Prop name | Type | Default | Required | Note |
---|---|---|---|---|
options | Array of OptionType | [] | true | Options array to render. Each item has a label, value and optional styling props |
onChange | Function | (v) => (console.log(v)) | true | onChange callback that returns selected Option's value |
name | string | undefined | false | HTML input name. Needed if you want to have multiple instances of the component |
initialSelectedIndex | number | 0 | false | Initially selected index of options array |
forcedSelectedIndex | number | undefined | false | Force selectedIndex with this prop (can be also used to resetting the toggle) |
border | string/number | 0 | false | Border of wrapping div |
backgroundColor | string | #ecf0f1 | false | Background color of wrapping div |
selectedBackgroundColor | string | #2ecc71 | false | Background of selected Option |
wrapperBorderRadius | number/CSS.Property.BorderRadius | 20 | false | Border radius of wrapping div |
optionBorderRadius | number/CSS.Property.BorderRadius | 18 | false | Border radius of Option component |
fontSize | number | 14 | false | Font size of Option's label |
fontColor | string | #000 | false | Font color of Option's label |
selectedFontColor | string | #fff | false | Font color of selected Option's label |
selectionIndicatorMargin | number | 2 | false | Inner px margin of selected option indicator |
disabled | boolean | false | false | Disabling the toggle |
Property name | Type | Default | Required | Note |
---|---|---|---|---|
label | string/number/ReactElement/HTMLElement | undefined | true | Option's label |
value | any | undefined | true | Option's value that is returned by onChange callback |
selectedBackgroundColor | string | undefined | false | Background of this selected Option |
fontColor | string | undefined | false | Font color of this Option's label |
selectedFontColor | string | undefined | false | Font color of this selected Option's label |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More