cosmos
cosmos copied to clipboard
Sidebar should allow flexibility to compose items
Is your feature request related to a problem? Please describe. Today's sidebar API is pretty rigid and doesn't allow any composability. I've had talks with designers and there's the need for flexibility for the Label. I think it's difficult to predict and encode these options in props. These are some rough examples of composability:
There's a caveat that our current labels/badges will need some shrinking to work. This is due to the Sidebar being too small. I believe we can update this down the line, and in the meantime allow teams to compose the sidebar better.
Describe the solution you'd like I believe we should allow passing the Label of the item as children. This would allow composing other components inside: another icon to the right, a tooltip, a label or a badge (or stuff we haven't come up yet).
Additional context This is similar to what Ant.design does: https://ant.design/components/menu/#components-menu-demo-inline
wdyt @siddharthkp @francocorreasosa ? Could this be part of the API refactor?