react-switcher-lite
v0.1.0
Published
Simple React switcher.
Downloads
4
Readme
react-switcher-lite
A React input switcher that allows toggling between two options.
Props
className string
An optional class name to add to the root div element for styling.
idSuffix string
An optional ID to append to the radio inputs to make them unique. This is useful if you mount this component multiple times in the same application.
onChange func
A callback for when the option changes. Update the value prop for the component here to toggle between the two options.
optionOne object
The first option for the switcher, containing a value and label field.
optionTwo object
The second option for the switcher, containing a value and label field.
value string
The value of the selected option.
License
MIT