Sha256: 43c8e68f29126cf15060d4e09222250711fc4e87ecdb44f012af571561a3a416

Contents?: true

Size: 1.38 KB

Versions: 1919

Compression:

Stored size: 1.38 KB

Contents

import React, { useState } from 'react'

import Radio from '../_radio'

const RadioCustom = (props) => {
  const [choice, setChoice] = useState('power')

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

  return (
    <div>
      <p>
        {'Your choice is: '}
        <code>{choice}</code>
      </p>
      <br />
      <Radio
          className="my_custom_class"
          label="Custom Power"
          {...props}
      >
        <input
            checked={choice === 'power'}
            name="custom"
            onChange={handleOnChange}
            type="radio"
            value="power"
            {...props}
        />
      </Radio>
      <br />
      <Radio
          className="my_custom_class"
          label="Custom Nitro"
          {...props}
      >
        <input
            checked={choice === 'nitro'}
            name="custom"
            onChange={handleOnChange}
            type="radio"
            value="nitro"
            {...props}
        />
      </Radio>
      <br />
      <Radio
          className="my_custom_class"
          label="Custom Google"
          {...props}
      >
        <input
            checked={choice === 'google'}
            name="custom"
            onChange={handleOnChange}
            type="radio"
            value="google"
            {...props}
        />
      </Radio>
    </div>
  )
}
export default RadioCustom

Version data entries

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

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx