Skip to content

MenuItemProps

MenuItemProps are the props of ReactComponent.MenuItem. The item’s label is its children.

type MenuItemProps = {
onClick?: React.MouseEventHandler<HTMLButtonElement>;
disabled?: boolean;
divider?: 'before' | 'after' | 'both';
leadingIcon?: React.ReactNode;
trailingIcon?: React.ReactNode;
icon?: React.ReactNode;
};
PropDescription
onClickRuns when the user clicks the item.
disabledDisables the item. Clicking a disabled item leaves the menu open.
dividerDraws a divider line before the item, after it, or on both sides.
leadingIcon, trailingIconThe icons before and after the label.
iconThe icon after the label. Spotify 1.2.8 deprecated it in favor of leadingIcon and trailingIcon.