Sha256: 7804b6eaada99d0ff649756c53e894721ea5b9b46d8326719ca8699bcd6e9c94
Contents?: true
Size: 587 Bytes
Versions: 50
Compression:
Stored size: 587 Bytes
Contents
import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { Dropdown, KebabToggle } from '@patternfly/react-core'; const DropdownToggle = ({ items, ...props }) => { const [isOpen, setOpen] = useState(false); return ( <Dropdown onSelect={() => setOpen(false)} toggle={<KebabToggle onToggle={value => setOpen(value)} />} isOpen={isOpen} isPlain dropdownItems={items} position="right" {...props} /> ); }; DropdownToggle.propTypes = { items: PropTypes.array.isRequired, }; export default DropdownToggle;
Version data entries
50 entries across 50 versions & 1 rubygems