UNPKG

1.3 kBTypeScriptView Raw
1/// <reference types="react" />
2import { SlotComponentProps } from '../utils/types';
3export interface MenuButtonRootSlotPropsOverrides {
4}
5export interface MenuButtonProps {
6 children?: React.ReactNode;
7 /**
8 * Class name applied to the root element.
9 */
10 className?: string;
11 /**
12 * If `true`, the component is disabled.
13 * @default false
14 */
15 disabled?: boolean;
16 /**
17 * If `true`, allows a disabled button to receive focus.
18 * @default false
19 */
20 focusableWhenDisabled?: boolean;
21 /**
22 * Label of the button
23 */
24 label?: string;
25 /**
26 * The props used for each slot inside the MenuButton.
27 * @default {}
28 */
29 slots?: MenuButtonSlots;
30 /**
31 * The components used for each slot inside the MenuButton.
32 * Either a string to use a HTML element or a component.
33 * @default {}
34 */
35 slotProps?: {
36 root?: SlotComponentProps<'button', MenuButtonRootSlotPropsOverrides, MenuButtonOwnerState>;
37 };
38}
39export interface MenuButtonSlots {
40 /**
41 * The component that renders the root.
42 * @default 'button'
43 */
44 root?: React.ElementType;
45}
46export type MenuButtonOwnerState = MenuButtonProps & {
47 active: boolean;
48 focusableWhenDisabled: boolean;
49 open: boolean;
50};