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

Version Path
playbook_ui_docs-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.34.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3368 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.34.0 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui-13.33.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
playbook_ui_docs-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx