HealthCatalyst / Fabric.Cashmere

Health Catalyst’s comprehensive design system.
http://cashmere.healthcatalyst.net
Apache License 2.0
66 stars 76 forks source link

Sidenav should support nested links OR content projection on the main body #2261

Closed isaaclyman closed 3 months ago

isaaclyman commented 9 months ago

Describe your idea

hc-sidenav should support links that have children (e.g. the SidenavLink interface should have a recursive children field) or it should support content projection in the main body (and provide a context variable indicating if the nav is expanded or collapsed).

The first option would be preferable so more of the behavior can be abstracted away, but the second might be easier to implement.

What problem are you trying to solve?

We've found that SidenavComponent lacks some key features we'd need in order to use it in BDS apps. We have nested links (up to 3 levels deep) in our sidenav, which is a necessity due to the number of pages in our apps, but also nice for keeping links organized.

We still use hc-drawer, which works fine, but it would be nice to get the look and feel of hc-sidenav.

corykon commented 8 months ago

@isaaclyman I've got a similar request from another application, so i'm going to get working on it soon.

Could you send me a screenshot of your current nav, and/or a list of the nav structure you after to make sure I meet the needs with the changes I make?

isaaclyman commented 8 months ago

PowerPlanning

Navigation, part 1

image

Navigation, part 2

image

Navigation, part 3

image

Hovered item

image

Colllapsed nav

image

PowerLabor

Navigation

image

Hovered item

image

Collapsed nav

image

corykon commented 8 months ago

Thank for that @isaaclyman. Here's where I'm headed. Call out anything you see that I'm missing.

Requirements

Mock Ups image image

isaaclyman commented 8 months ago

Looks great, @corykon. How customizable are the labels of those links? You'll notice that there are a few cases where we show a status chip on the link, e.g. BETA. If there's a custom HTML option, that would be great, or something more specific - just so long as we're not restricted to a string.

corykon commented 8 months ago

Yeah that's a good callout :+1:

andrew-frueh commented 8 months ago

Love these updated concepts @isaaclyman and @corykon - adds a lot of depth to the side nav. Great work!