Sha256: fb4d4031ed2cac5a9ba13dc9f14a287af89ca264964a37566884a969ba65fbe9

Contents?: true

Size: 1.16 KB

Versions: 1497

Compression:

Stored size: 1.16 KB

Contents

import React, { useState } from 'react'
import SelectableCard from '../_selectable_card.tsx'

const SelectableCardSingleSelect = (props) => {
  const [selected, setSelected] = useState(null)
  const handleSelect = (event) => {
    setSelected(event.target.value)
  }

  return (
    <div className="pb--doc-demo-row">

      <SelectableCard
          checked={selected === 'male'}
          inputId="male1"
          multi={false}
          name="gender"
          onChange={handleSelect}
          value="male"
          {...props}
      >
        {'Male'}
      </SelectableCard>

      <SelectableCard
          checked={selected === 'female'}
          inputId="female1"
          multi={false}
          name="gender"
          onChange={handleSelect}
          value="female"
          {...props}
      >
        {'Female'}
      </SelectableCard>

      <SelectableCard
          checked={selected === 'other'}
          inputId="other1"
          multi={false}
          name="gender"
          onChange={handleSelect}
          value="other"
          {...props}
      >
        {'Other'}
      </SelectableCard>

    </div>
  )
}

export default SelectableCardSingleSelect

Version data entries

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

Version Path
playbook_ui_docs-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx