UNPKG

2.41 kBTypeScriptView Raw
1import * as React from 'react';
2import { OUIAProps } from '../../helpers';
3export interface DropdownToggleProps extends React.HTMLProps<HTMLButtonElement>, OUIAProps {
4 /** HTML ID of dropdown toggle */
5 id?: string;
6 /** Anything which can be rendered as dropdown toggle button */
7 children?: React.ReactNode;
8 /** Classes applied to root element of dropdown toggle button */
9 className?: string;
10 /** Flag to indicate if menu is opened */
11 isOpen?: boolean;
12 /** Callback called when toggle is clicked */
13 onToggle?: (value: boolean, event: any) => void;
14 /** Element which wraps toggle */
15 parentRef?: HTMLElement;
16 /** The menu element */
17 getMenuRef?: () => HTMLElement;
18 /** Forces active state */
19 isActive?: boolean;
20 /** Display the toggle with no border or background */
21 isPlain?: boolean;
22 /** Display the toggle in text only mode */
23 isText?: boolean;
24 /** Whether or not the <div> has a disabled state */
25 isDisabled?: boolean;
26 /** @deprecated Use `toggleVariant` instead. Whether or not the dropdown toggle button should have primary button styling */
27 isPrimary?: boolean;
28 /** Alternate styles for the dropdown toggle button */
29 toggleVariant?: 'primary' | 'secondary' | 'default';
30 /** An image to display within the dropdown toggle, appearing before any component children */
31 icon?: React.ReactNode;
32 /** The icon to display for the toggle, appearing after any component children. Defaults to CaretDownIcon. Set to null to not show an icon. */
33 toggleIndicator?: React.ElementType | null;
34 /** Elements to display before the toggle button. When included, renders the toggle as a split button. */
35 splitButtonItems?: React.ReactNode[];
36 /** Variant of split button toggle */
37 splitButtonVariant?: 'action' | 'checkbox';
38 /** Accessible label for the dropdown toggle button */
39 'aria-label'?: string;
40 /** Accessibility property to indicate correct has popup */
41 'aria-haspopup'?: boolean | 'listbox' | 'menu' | 'dialog' | 'grid' | 'tree';
42 /** Type to put on the button */
43 type?: 'button' | 'submit' | 'reset';
44 /** Callback called when the Enter key is pressed */
45 onEnter?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
46}
47export declare const DropdownToggle: React.FunctionComponent<DropdownToggleProps>;
48//# sourceMappingURL=DropdownToggle.d.ts.map
\No newline at end of file