forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDropdownGroup.tsx
More file actions
27 lines (25 loc) · 878 Bytes
/
DropdownGroup.tsx
File metadata and controls
27 lines (25 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { css } from '@patternfly/react-styles';
import { MenuGroupProps, MenuGroup } from '../Menu';
/**
* See the MenuGroup section of the Menu documentation for additional props that may be passed.
*/
export interface DropdownGroupProps extends Omit<MenuGroupProps, 'ref'> {
/** Anything which can be rendered in a dropdown group. */
children: React.ReactNode;
/** Classes applied to root element of dropdown group */
className?: string;
/** Label of the dropdown group */
label?: React.ReactNode;
}
export const DropdownGroup: React.FunctionComponent<DropdownGroupProps> = ({
children,
className,
label,
labelHeadingLevel = 'h1',
...props
}: DropdownGroupProps) => (
<MenuGroup className={css(className)} label={label} labelHeadingLevel={labelHeadingLevel} {...props}>
{children}
</MenuGroup>
);
DropdownGroup.displayName = 'DropdownGroup';