UNPKG

@synergycodes/axiom

Version:

A React library for creating node-based UIs and diagram-driven applications. Perfect for React Flow users, providing ready-to-use node templates and components that work seamlessly with React Flow's ecosystem.

45 lines (44 loc) 1.74 kB
import { ReactElement, MouseEvent, KeyboardEvent, FocusEvent } from 'react'; import { MenuProps as MenuBaseProps } from '@mui/base/Menu'; import { MenuItemProps } from './types'; import { ItemSize } from '../../shared/types/item-size'; import { OffsetOptions, Placement } from '@floating-ui/react'; type MenuProps = MenuBaseProps & { /** * Array of menu items to be rendered in the menu. * Each item can be either a regular menu item or a separator. */ items: MenuItemProps[]; /** * Size variant for the menu items. * @default 'medium' */ size?: ItemSize; /** * The preferred placement of the menu relative to its trigger element. * Uses Floating UI placement options. * @default 'bottom-end' */ placement?: Placement | undefined; /** * Controls whether the menu is open or closed. * When omitted, the menu's open state will be managed internally * and toggled by clicking on the `children` trigger element. */ open?: boolean | undefined; /** * Callback fired when the component requests to be opened or closed. */ onOpenChange?: (event: MouseEvent | KeyboardEvent | FocusEvent | null, open: boolean) => void; /** * Distance between a popup and the trigger element */ offset?: OffsetOptions; /** * The trigger element that will open the menu when clicked. * This element will be wrapped in a button with appropriate ARIA attributes. */ children?: ReactElement; }; export declare const Menu: import('react').MemoExoticComponent<({ items, size, placement, children, slotProps, open, offset, onOpenChange, ...props }: MenuProps) => import("react/jsx-runtime").JSX.Element>; export {};