Sha256: 2029f465275ce6526f8f44431e0e3aed7af9406d82ce13a7ddcc7c7134c1ef1a

Contents?: true

Size: 925 Bytes

Versions: 104

Compression:

Stored size: 925 Bytes

Contents

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

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

104 entries across 104 versions & 1 rubygems

Version Path
playbook_ui-9.19.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx