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-14.8.0.pre.rc.2 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.alpha.spacingquickchange4482 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.alpha.spacingquickchange4482 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4478 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4478 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.8.0.pre.rc.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.rc.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.alpha.dependabotnpmandyarnintltelinput24704448 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnintltelinput24704448 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.8.0.pre.rc.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.8.0.pre.rc.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.6.2.pre.alpha.PLAY1613darkdatetimecolors4432 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.6.2.pre.alpha.PLAY1613darkdatetimecolors4432 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.rc.19 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.rc.19 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui_docs-14.7.0.pre.rc.18 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-14.7.0.pre.rc.18 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx