@yamada-ui/menu
Version:
Yamada UI menu component
91 lines (88 loc) • 2.43 kB
text/typescript
import * as _yamada_ui_core from '@yamada-ui/core';
import { HTMLUIProps } from '@yamada-ui/core';
import { ReactElement } from 'react';
interface MenuItemOptions {
/**
* If `true`, the list element will be closed when selected.
*
* @default false
*/
closeOnSelect?: boolean;
/**
* Right-aligned label text content, useful for displaying hotkeys.
*/
command?: string;
/**
* If `true`, the menu item will be disabled.
*
* @default false
*/
disabled?: boolean;
/**
* If `true`, the menu item will be focusable.
*
* @default false
*/
focusable?: boolean;
/**
* The menu item icon to use.
*/
icon?: ReactElement;
/**
* If `true`, the menu item will be disabled.
*
* @default false
*
* @deprecated Use `disabled` instead.
*/
isDisabled?: boolean;
/**
* If `true`, the menu item will be focusable.
*
* @default false
*
* @deprecated Use `focusable` instead.
*/
isFocusable?: boolean;
}
interface MenuItemProps extends HTMLUIProps, MenuItemOptions {
}
declare const MenuItem: _yamada_ui_core.Component<"div", MenuItemProps>;
interface MenuOptionItemOptions {
/**
* The type of the menu option item.
*/
type?: "checkbox" | "radio";
/**
* If `true`, the checkbox or radio will be checked.
*
* @default false
*/
checked?: boolean;
/**
* The menu option item icon to use.
*/
icon?: null | ReactElement;
/**
* If `true`, the checkbox or radio will be checked.
*
* @default false
*
* @deprecated Use `checked` instead.
*/
isChecked?: boolean;
/**
* The value of the menu option item.
*/
value?: string;
}
interface MenuOptionItemProps extends Omit<MenuItemProps, "command" | "icon" | "value">, MenuOptionItemOptions {
}
declare const MenuOptionItem: _yamada_ui_core.Component<"button", MenuOptionItemProps>;
interface MenuIconProps extends HTMLUIProps<"span"> {
}
declare const MenuIcon: _yamada_ui_core.Component<"span", MenuIconProps>;
interface MenuCommandProps extends HTMLUIProps<"span"> {
}
declare const MenuCommand: _yamada_ui_core.Component<"span", MenuCommandProps>;
export { MenuCommand, type MenuCommandProps, MenuIcon, type MenuIconProps, MenuItem, type MenuItemProps, MenuOptionItem, type MenuOptionItemProps };