Debian Codegraph @

node/@patternfly/react-core/src/components/Dropdown/DropdownGroup.tsx

raw
1 import { css } from '@patternfly/react-styles';
2 import { MenuGroupProps, MenuGroup } from '../Menu';
3
4 /**
5 * See the MenuGroup section of the Menu documentation for additional props that may be passed.
6 */
7 export interface DropdownGroupProps extends Omit<MenuGroupProps, 'ref'> {
8 /** Anything which can be rendered in a dropdown group. */
9 children: React.ReactNode;
10 /** Classes applied to root element of dropdown group */
11 className?: string;
12 /** Label of the dropdown group */
13 label?: React.ReactNode;
14 }
15
16 export const DropdownGroup: React.FunctionComponent<DropdownGroupProps> = ({
17 children,
18 className,
19 label,
20 labelHeadingLevel = 'h1',
21 ...props
22 }: DropdownGroupProps) => (
23 <MenuGroup className={css(className)} label={label} labelHeadingLevel={labelHeadingLevel} {...props}>
24 {children}
25 </MenuGroup>
26 );
27 DropdownGroup.displayName = 'DropdownGroup';