API reference: @salmonui/buttons/menu
MenuItemPropsinterface
import type { MenuItemProps } from '@salmonui/buttons/menu';interface MenuItemProps extends ItemCommonProps {
readonly id: string;
readonly item?: MenuItemData | undefined;
readonly href?: string | undefined;
readonly target?: string | undefined;
readonly onAction?: (event: MenuActionEvent) => void;
readonly render?: (props: MenuItemRenderProps) => ReactElement;
}
| Name | Signature | Description |
|---|---|---|
id | readonly id: string; | Stable item key reported in |
itemoptional | readonly item?: MenuItemData | undefined; | The data entry reported in |
hrefoptional | readonly href?: string | undefined; | Renders |
targetoptional | readonly target?: string | undefined; | |
onActionoptional | readonly onAction?: (event: MenuActionEvent) => void; | This item was chosen; |
renderoptional | readonly render?: (props: MenuItemRenderProps) => ReactElement; | Custom element (router links): |
childrenoptionalinherited | children?: ReactNode; | |
iconoptionalinherited | icon?: ReactNode; | Decorative leading icon ( |
disabledoptionalinherited | disabled?: boolean; | Skipped by arrow keys and typeahead; |
textValueoptionalinherited | textValue?: string; | Typeahead text when the children are not plain text. |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
refoptionalinherited | ref?: Ref<HTMLElement>; | |
onClickoptionalinherited | onClick?: ((event: MouseEvent<HTMLElement, MouseEvent>) => void); |