MenuItemProps
The MenuItemProps object is used to create a menu item.
type MenuItemProps = { onClick?: React.MouseEventHandler<HTMLButtonElement>; disabled?: boolean; divider?: 'before' | 'after' | 'both'; icon?: React.ReactNode; leadingIcon?: React.ReactNode; trailingIcon?: React.ReactNode;};Properties
| Property | Type | Description |
|---|---|---|
onClick | React.MouseEventHandler<HTMLButtonElement> | undefined | Function that runs when MenuItem is clicked |
disabled | boolean | undefined | Indicates if MenuItem is disabled. Disabled items will not cause the Menu to close when clicked. |
divider | 'before' | 'after' | 'both' | undefined | Indicate that a divider line should be added before or after this MenuItem |
icon | React.ReactNode | undefined | React component icon that will be rendered at the end of the MenuItem. Deprecated: Since Spotify 1.2.8. Use leadingIcon or trailingIcon instead |
leadingIcon | React.ReactNode | undefined | React component icon that will be rendered at the start of the MenuItem. Since Spotify 1.2.8 |
trailingIcon | React.ReactNode | undefined | React component icon that will be rendered at the start of the MenuItem. Since Spotify 1.2.8 |