UNPKG

@payfit/unity-components

Version:

32 lines (31 loc) • 1.24 kB
import { PropsWithChildren } from 'react'; export interface MenuTriggerProps { /** Adds classes to the trigger element. */ className?: string; /** Renders the provided child as the trigger without an extra button. */ asChild?: boolean; } /** * Renders the control that opens a `Menu`. * * Use a text child for the default Unity trigger or set `asChild` to compose * an existing Unity button or icon button without introducing a second * interactive element. * @param props - Trigger content and composition options. * @param props.children - The text or control that opens the menu. * @param props.asChild - Renders the child directly as the trigger element. * @param props.className - Adds classes to the trigger element. * @see {@link Menu} for the complete menu composition. * @example * ```tsx * import { IconButton, MenuTrigger } from '@payfit/unity-components' * * <MenuTrigger asChild> * <IconButton icon="DotsThreeOutlined" label="More actions" /> * </MenuTrigger> * ``` */ export declare function MenuTrigger({ children, asChild, className, }: PropsWithChildren<MenuTriggerProps>): import('react/jsx-runtime').JSX.Element; export declare namespace MenuTrigger { var displayName: string; }