UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

46 lines (45 loc) 1.34 kB
import * as React from 'react'; import type { BaseUIComponentProps } from '../../utils/types.js'; /** * An individual interactive item in the menu. * Renders a `<div>` element. * * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu) */ declare const MenuItem: React.ForwardRefExoticComponent<MenuItem.Props & React.RefAttributes<Element>>; declare namespace MenuItem { type State = { /** * Whether the component should ignore user interaction. */ disabled: boolean; highlighted: boolean; }; interface Props extends BaseUIComponentProps<'div', State> { children?: React.ReactNode; /** * The click handler for the menu item. */ onClick?: React.MouseEventHandler<HTMLElement>; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean; /** * Overrides the text label to use when the item is matched during keyboard text navigation. */ label?: string; /** * @ignore */ id?: string; /** * Whether to close the menu when the item is clicked. * * @default true */ closeOnClick?: boolean; } } export { MenuItem };