gravity-ui / navigation

https://preview.gravity-ui.com/navigation
MIT License
19 stars 4 forks source link

feat(MenuItem): add description #221

Closed artemavrin closed 2 months ago

artemavrin commented 2 months ago

menu item needs some description sometimes

gravity-ui-bot commented 2 months ago

Preview is ready.

Lunory commented 2 months ago

You can show description in current realization without adding additional prop. title prop in menuItems has ReactNode type. I'd rather this way. https://github.com/gravity-ui/navigation/blob/main/src/components/types.ts#L18

For example:

{
    id: 'menu-item-1',
    title: <div>Title <div>description</div></div>,
    icon: Gear,
    itemWrapper(params, makeItem, {compact}) {
        return (
            <div className="container">
                {makeItem(params)}
            </div>
        );
    },
}
artemavrin commented 2 months ago

Hm, you're right, thx!