View as Markdown

API reference: @salmonui/buttons/menu

MenubarItemPropsinterface

import type { MenubarItemProps } from '@salmonui/buttons/menu';
interface MenubarItemProps extends TopItemDomProps {
    readonly id: string;
    readonly children?: ReactNode;
    readonly icon?: ReactNode;
    readonly disabled?: boolean;
    readonly textValue?: string;
    readonly href?: string;
    readonly target?: string;
    readonly onAction?: (event: MenuActionEvent) => void;
    readonly render?: (props: MenuItemRenderProps) => ReactElement;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly ref?: Ref<HTMLElement>;
}
MenubarItemProps members (12)
NameSignatureDescription
idreadonly id: string;

Stable key reported in onAction.

childrenoptionalreadonly children?: ReactNode;
iconoptionalreadonly icon?: ReactNode;
disabledoptionalreadonly disabled?: boolean;
textValueoptionalreadonly textValue?: string;
hrefoptionalreadonly href?: string;

Renders <a role="menuitem" href>.

targetoptionalreadonly target?: string;
onActionoptionalreadonly onAction?: (event: MenuActionEvent) => void;

Runs before the bar's onAction; event.preventDefault() stops link navigation.

renderoptionalreadonly render?: (props: MenuItemRenderProps) => ReactElement;

Custom element (router links): render={(props) => <Link {...props} to="/help" />}; spread every prop.

classNameoptionalreadonly className?: string;
styleoptionalreadonly style?: CSSProperties;
refoptionalreadonly ref?: Ref<HTMLElement>;