Sha256: 0bd5cbad50910d73237cf901ce7916bb8d5480aeb9efe6b6d726d6c22af208a3

Contents?: true

Size: 981 Bytes

Versions: 6

Compression:

Stored size: 981 Bytes

Contents

import React, { useState } from 'react'
import { Dropdown } from '../../'

const DropdownDefault = (props) => {
// eslint-disable-next-line no-unused-vars
const [selectedOption, setSelectedOption] = useState();

  const options = [
    {
      label: "United States",
      value: "United States",
      areaCode: "+1",
      icon: "πŸ‡ΊπŸ‡Έ",
      id: "United-states"
    },
    {
      label: "Canada",
      value: "Canada",
      areaCode: "+1",
      icon: "πŸ‡¨πŸ‡¦",
      id: "canada"
    },
    {
      label: "Pakistan",
      value: "Pakistan",
      areaCode: "+92",
      icon: "πŸ‡΅πŸ‡°",
      id: "pakistan"
    }
  ];  


  return (
  <div>
    <Dropdown
        onSelect={(selectedItem) => setSelectedOption(selectedItem)}
        options={options}
        {...props}
    >
      {options.map((option) => (
        <Dropdown.Option key={option.id} 
            option={option}
        /> 
      ))}
    </Dropdown>
  </div>
  )
}

export default DropdownDefault

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
playbook_ui_docs-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
playbook_ui_docs-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
playbook_ui_docs-13.25.0.pre.alpha.barchartfix2766 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
playbook_ui-13.25.0.pre.alpha.barchartfix2766 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx