0.2.1 • Published 3 years ago
@thesis-ui/toggle v0.2.1
Toggle component - Thesis UI
Installation
$ yarn add @thesis-ui/toggle
$ npm install @thesis-ui/toggle
Usage
import Toggle from '@thesis-ui/toggle';
const [isOn, setIsOn] = useState(false);
function onChange() {
setIsOn(!isOn);
}
<Toggle
isChecked={isOn}
value="testValue"
labelValue={`Click me to turn ${isOn ? 'off' : 'on'}`}
onChange={onChange}
/>