import { Fragment, useState, FunctionComponent } from 'react'; import { Checkbox, Flex, FlexItem } from '@patternfly/react-core'; import { SimpleDropdown, SimpleDropdownItem } from '@patternfly/react-templates'; import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon'; export const SimpleDropdownExample: FunctionComponent = () => { const [isDisabled, setIsDisabled] = useState(false); const items: SimpleDropdownItem[] = [ // eslint-disable-next-line no-console { content: 'Action', value: 1, onClick: () => console.log('Action clicked') }, // Prevent default click behavior on link for example purposes { content: 'Link', value: 2, to: '#', onClick: (event: any) => event.preventDefault() }, { content: 'Disabled Action', value: 3, isDisabled: true }, { value: 'separator', isDivider: true }, // eslint-disable-next-line no-console { content: 'Second action', value: 4, onClick: () => console.log('Second action clicked') } ]; return ( , checked: boolean) => setIsDisabled(checked)} style={{ marginBottom: 20 }} /> } toggleAriaLabel="Plain dropdown toggle" /> ); };