@htmlbricks/hb-sidebar-cards-navigator
v0.71.16
Published
Stacked sidebar navigator: picks an active panel from JSON panels (main or first without parent), shows hb-navbar with back when parentPanelId exists, then cards of rows rendered as hb-sidenav-button. Emits itemClick with panel, card and row context; rows
Readme
hb-sidebar-cards-navigator — sidebar cards navigator
Category: layout
Tags: layout, navigation
What it does
Stacked sidebar navigator: picks an active panel from JSON panels (main or first without parent), shows hb-navbar with back when parentPanelId exists, then cards of rows rendered as hb-sidenav-button. Emits itemClick with panel, card and row context; rows can switch panels via switchToPanelId.
Custom element
hb-sidebar-cards-navigator
Attributes (snake_case; use string values in HTML)
id,style(optional): strings.panels(optional): JSON string —Panel[](id, optionaltitle,parentPanelId,cardswithrowsofCardRow:key,text, optionalbootstrapIcon,switchToPanelId,type,badge, etc.).
Events
itemClick: detail matches selected row context (panel, card, row,id) as built incomponent.wc.svelte— see typesCardRowSelectedinwebcomponent.type.d.ts.
Usage notes
- Slots:
skelcontent. - CSS parts:
testpart. - Type file lists a nested
event.itemClickshape; the element dispatches the event nameitemClickat the top level.
Minimal HTML example
<hb-sidebar-cards-navigator
panels='[{"id":"1","title":"Home","cards":[{"id":"c1","rows":[{"key":"a","text":"Item","bootstrapIcon":"house-door"}]}]}]'
></hb-sidebar-cards-navigator>