Sha256: b41a82cef91e85a9e2abad1f756b5099c43c41a45a06d2ed79f30fb2712951e7
Contents?: true
Size: 1.38 KB
Versions: 671
Compression:
Stored size: 1.38 KB
Contents
import React from 'react' import { Dropdown, Icon, Body, FlexItem, Flex } from 'playbook-ui' const DropdownWithCustomOptions = (props) => { 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 options={options} {...props} > {options.map((option) => ( <Dropdown.Option key={option.id} option={option} > <Flex align="center" justify="between" > <FlexItem> <Flex> <Icon icon={option.icon} paddingRight="xs" /> <Body text={option.label} /> </Flex> </FlexItem> <FlexItem> <Body color="light" text={option.areaCode} /> </FlexItem> </Flex> </Dropdown.Option> ))} </Dropdown> </div> ) } export default DropdownWithCustomOptions
Version data entries
671 entries across 671 versions & 2 rubygems