Sha256: b0f2c94993c0f07b606de34ee3a8cd2595a53ab8989661c4937e6b0b8f6f5535

Contents?: true

Size: 1002 Bytes

Versions: 1644

Compression:

Stored size: 1002 Bytes

Contents

import React, { useState } from 'react'

import FormGroup from '../../pb_form_group/_form_group'
import SelectableCard from '../../pb_selectable_card/_selectable_card'

const FormGroupSelectableCard = (props) => {
  const [value, setValue] = useState('')

  const handleSelect = (event) => {
    setValue(event.target.value)
  }

  return (
    <div>
      <FormGroup>
        <SelectableCard
            checked={value === 'cat'}
            inputId="cat1"
            multi={false}
            name="animal"
            onChange={handleSelect}
            value="cat"
            {...props}
        >
          {'Cat'}
        </SelectableCard>

        <SelectableCard
            checked={value === 'dog'}
            inputId="dog1"
            multi={false}
            name="animal"
            onChange={handleSelect}
            value="dog"
            {...props}
        >
          {'Dog'}
        </SelectableCard>
      </FormGroup>
    </div>
  )
}

export default FormGroupSelectableCard

Version data entries

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

Version Path
playbook_ui_docs-14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.7.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4523 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.7.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4523 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.8 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.8 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.7 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.7 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.6 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.6 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.5 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.5 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.4 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.4 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.3 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.8.0.pre.rc.3 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4492 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4492 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui_docs-14.8.0.pre.rc.2 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx