A fully configurable multiple switch component.
Installation
npm install react-multi-switch-toggle
You can import each animation directly from the main package
import MultiSwitch from 'react-multi-switch-toggle'
class App extends Component {
render() {
return (
<div className="App">
<MultiSwitch
texts={[
'sa 1sa',
'sa 2sa',
'sa 3sa',
'sa 4sa',
'sa 5sa',
'sa 6sa',
]}
selectedSwitch={4}
bgColor={'#e57168'}
onToggleCallback={this.onToggle}
fontColor={'white'}
selectedFontColor={'#1e311b'}
eachSwitchWidth={150}
height={'50px'}
fontSize={'16px'}
>
</MultiSwitch>
</div>
);
}
onToggle(selectedItem){
console.log(selectedItem)
}
}
Array of display texts
Selected switch
Background color
Border width
Selected font color
Selected switch color
Font size
Font weight
Static text after the animating value
Width of each switch
Height of the component