Sha256: 1562443ff3913a9ac05095d17cccad625b7bb2bb55fdbd0c7dca8ccd0b4949b2

Contents?: true

Size: 1.22 KB

Versions: 1169

Compression:

Stored size: 1.22 KB

Contents

// @flow

import React, { useState } from 'react'
import { Caption, Title, Toggle } from '../..'

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

1,169 entries across 1,169 versions & 2 rubygems

Version Path
playbook_ui-6.2.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.2.0 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx