UNPKG

rsuite

Version:

A suite of react components

56 lines (55 loc) 1.83 kB
import React from 'react'; import { IconProps } from '@rsuite/icons/Icon'; import type { RsRefForwardingComponent, WithAsProps } from '../internals/types'; export interface DropdownMenuItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> { /** Active the current option */ active?: boolean; /** Primary content */ children?: React.ReactNode; /** You can use a custom element for this component */ as?: React.ElementType; /** * Whether to display the divider * * @deprecated Use dedicated <Dropdown.Separator> component instead */ divider?: boolean; /** Disable the current option */ disabled?: boolean; /** The value of the current option */ eventKey?: T; /** Displays a custom panel */ panel?: boolean; /** Set the icon */ icon?: React.ReactElement<IconProps>; /** The submenu that this menuitem controls (if exists) */ submenu?: React.ReactElement; /** * The sub-level menu appears from the right side by default, and when `pullLeft` is set, it appears from the left. * @deprecated Submenus are now pointing the same direction. */ pullLeft?: boolean; /** * Whether the submenu is opened. * @deprecated * @internal */ open?: boolean; /** * The dropdown item keyboard shortcut. * * @version 5.58.0 */ shortcut?: React.ReactNode; /** * Select the callback function for the current option */ onSelect?: (eventKey: T, event: React.SyntheticEvent) => void; } /** * The `<Dropdown.Item>` API * - When used inside `<Sidenav>`, renders a `<TreeviewItem>` * - Otherwise renders a `<MenuItem>` */ declare const DropdownItem: RsRefForwardingComponent<'li', DropdownMenuItemProps>; export default DropdownItem;