Sha256: 8c194b4449c08b4af7bc0f13daf307595c50d8b88a6f91385093693efcba0539

Contents?: true

Size: 1.26 KB

Versions: 187

Compression:

Stored size: 1.26 KB

Contents

import React from 'react'
import SelectableCard from '../_selectable_card.jsx'

class SelectableCardSingleSelect extends React.Component {
  state = {
    selected: null,
  }

  handleSelect = (event) => {
    this.setState({
      selected: event.target.value,
    })
  }

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

        <SelectableCard
            checked={this.state.selected === 'male'}
            inputId="male1"
            multi={false}
            name="gender"
            onChange={this.handleSelect.bind(this)}
            value="male"
        >
          {'Male'}
        </SelectableCard>

        <SelectableCard
            checked={this.state.selected === 'female'}
            inputId="female1"
            multi={false}
            name="gender"
            onChange={this.handleSelect.bind(this)}
            value="female"
        >
          {'Female'}
        </SelectableCard>

        <SelectableCard
            checked={this.state.selected === 'other'}
            inputId="other1"
            multi={false}
            name="gender"
            onChange={this.handleSelect.bind(this)}
            value="other"
        >
          {'Other'}
        </SelectableCard>

      </div>
    )
  }
}

export default SelectableCardSingleSelect

Version data entries

187 entries across 187 versions & 1 rubygems

Version Path
playbook_ui-7.11.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.11.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.10.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.9.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.8.4 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.8.3 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.7.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.6.2 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.6.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.6.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.5.1 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.5.0 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx
playbook_ui-7.4.2 app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx