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.

41 lines 1.6 kB
import * as React from 'react'; import type { InteractionType } from '@base-ui-components/utils/useEnhancedClickHandler'; import type { BaseUIComponentProps } from "../../utils/types.js"; import type { Side, Align } from "../../utils/useAnchorPositioning.js"; import type { TransitionStatus } from "../../utils/useTransitionStatus.js"; /** * A container for the menu items. * Renders a `<div>` element. * * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu) */ export declare const MenuPopup: React.ForwardRefExoticComponent<MenuPopup.Props & React.RefAttributes<Element>>; export declare namespace MenuPopup { interface Props extends BaseUIComponentProps<'div', State> { children?: React.ReactNode; /** * @ignore */ id?: string; /** * Determines the element to focus when the menu is closed. * * - `false`: Do not move focus. * - `true`: Move focus based on the default behavior (trigger or previously focused element). * - `RefObject`: Move focus to the ref element. * - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). * Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing. */ finalFocus?: boolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void); } type State = { transitionStatus: TransitionStatus; side: Side; align: Align; /** * Whether the menu is currently open. */ open: boolean; nested: boolean; }; }