Sha256: c4647d45685578119c610d835f875397b83b85adc19a09c7bb74850b01302fa0
Contents?: true
Size: 997 Bytes
Versions: 1169
Compression:
Stored size: 997 Bytes
Contents
// @flow import React, { useState } from 'react' import { Caption, Title, Toggle } from '../..' const ToggleName = () => { const [choice, setChoice] = useState(false) const handleOnChange = ({ target }) => { setChoice(target.value = !choice) } return ( <> <Title size={4} text="Which of the following vehicles do you own?" /> <br /> <Caption text="Car" /> <Toggle checked={choice} size="sm" > <input name="vehicle" onChange={handleOnChange} type="checkbox" value="car" /> </Toggle> <br /> <Caption text="Bike" /> <Toggle checked={choice} size="sm" > <input name="vehicle" onChange={handleOnChange} type="checkbox" value="bike" /> </Toggle> </> ) } export default ToggleName
Version data entries
1,169 entries across 1,169 versions & 2 rubygems