Sha256: 239c58b010dacdd8686cafa4830eb5b61e315eb40802e2b6efa30cfd55a50a4b

Contents?: true

Size: 1.22 KB

Versions: 944

Compression:

Stored size: 1.22 KB

Contents

import React, { useState } from 'react'
import { Caption, Title, Toggle } from 'playbook-ui'

const ToggleCustomRadio = () => {
  const [choice, setChoice] = useState('walk')

  const handleOnChange = ({ target }) => {
    setChoice(target.value)
  }

  return (
    <>
      <Title
          size={4}
          text="Select one option:"
      />

      <br />

      <Caption
          text="Walk"
      />
      <Toggle
          checked={choice}
          size="sm"
      >
        <input
            name="modes of transportation"
            onChange={handleOnChange}
            type="radio"
            value="walk"
        />
      </Toggle>

      <br />

      <Caption
          text="Bike"
      />
      <Toggle
          size="sm"
      >
        <input
            name="modes of transportation"
            onChange={handleOnChange}
            type="radio"
            value="bike"
        />
      </Toggle>

      <br />

      <Caption
          text="Ride"
      />
      <Toggle
          size="sm"
      >
        <input
            name="modes of transportation"
            onChange={handleOnChange}
            type="radio"
            value="ride"
        />
      </Toggle>
    </>
  )
}

export default ToggleCustomRadio

Version data entries

944 entries across 944 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY1720phonenumberinputformatAsYouType5377 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1720phonenumberinputformatAsYouType5377 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.play17725374 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.play17725374 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.play17725372 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.play17725372 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.12.0.pre.rc.4 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.12.0.pre.rc.4 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.hfhbrakemanplaybook5370 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.hfhbrakemanplaybook5370 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.responsivetablerails5364 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.responsivetablerails5364 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.responsivetablerails5362 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.responsivetablerails5362 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR769sticky5359 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR769sticky5359 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx