@cbinsights/fds
Version:
Form: A design system by CB Insights
16 lines (15 loc) • 1.04 kB
TypeScript
import React from 'react';
export interface MenuItemProps {
/** Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node. */
asChild?: boolean;
/** When true, prevents the user from interacting with the item. */
disabled?: boolean;
/** Event handler called when the user selects an item (via mouse or keyboard). Calling event.preventDefault in this handler will prevent the context menu from closing when selecting that item. */
onSelect?: (event: Event) => void;
/** Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside. */
textValue?: string;
/** Menu items */
children: React.ReactNode;
}
declare const MenuItem: ({ children, disabled, onSelect, ...rest }: MenuItemProps) => JSX.Element;
export default MenuItem;