UNPKG

2.23 kBTypeScriptView Raw
1import * as React from 'react';
2import { DropdownPosition, DropdownDirection, DropdownContext } from './dropdownConstants';
3import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
4import { OUIAProps } from '../../helpers';
5export interface DropdownProps extends ToggleMenuBaseProps, React.HTMLProps<HTMLDivElement>, OUIAProps {
6 /** Anything which can be rendered in a dropdown */
7 children?: React.ReactNode;
8 /** Classes applied to root element of dropdown */
9 className?: string;
10 /** Array of DropdownItem nodes that will be rendered in the dropdown Menu list */
11 dropdownItems?: any[];
12 /** Flag to indicate if menu is opened */
13 isOpen?: boolean;
14 /** Display the toggle with no border or background */
15 isPlain?: boolean;
16 /** Display the toggle in text only mode */
17 isText?: boolean;
18 /** Flag indicating that the dropdown should expand to full height */
19 isFullHeight?: boolean;
20 /** Indicates where menu will be aligned horizontally */
21 position?: DropdownPosition | 'right' | 'left';
22 /** Indicates how the menu will align at screen size breakpoints. Default alignment is set via the position property. */
23 alignments?: {
24 sm?: 'right' | 'left';
25 md?: 'right' | 'left';
26 lg?: 'right' | 'left';
27 xl?: 'right' | 'left';
28 '2xl'?: 'right' | 'left';
29 };
30 /** Display menu above or below dropdown toggle */
31 direction?: DropdownDirection | 'up' | 'down';
32 /** Flag to indicate if dropdown has groups */
33 isGrouped?: boolean;
34 /** Toggle for the dropdown, examples: <DropdownToggle> or <DropdownToggleCheckbox> */
35 toggle: React.ReactElement<any>;
36 /** Function callback called when user selects item */
37 onSelect?: (event?: React.SyntheticEvent<HTMLDivElement>) => void;
38 /** Flag to indicate if the first dropdown item should gain initial focus, set false when adding
39 * a specific auto-focus item (like a current selection) otherwise leave as true
40 */
41 autoFocus?: boolean;
42 /** Props for extreme customization of dropdown */
43 contextProps?: typeof DropdownContext;
44}
45export declare const Dropdown: React.FunctionComponent<DropdownProps>;
46//# sourceMappingURL=Dropdown.d.ts.map
\No newline at end of file