@htmlbricks/hb-sidenav-button
v0.71.7
Published
Compact sidebar row as a nav button: optional Bootstrap Icons (bi-*) icon, Bulma tag badge, or visual types (switch, checkbox, radio) from navlink JSON; dispatches pageChange with the row key on click. Used by sidebar-cards-navigator and similar stacked m
Readme
hb-sidenav-button — sidenav button
Category: layout
Tags: layout, navigation
What it does
Compact sidebar row as a nav button: optional Bootstrap Icons (bi-*) via bootstrapIcon, Bulma tag badge (optional badge.class / badge.classcolor modifiers), or visual types (switch, checkbox, radio) from navlink JSON; dispatches pageChange with the row key on click. Used by hb-sidebar-cards-navigator and similar stacked menus.
Custom element
hb-sidenav-button
Attributes (snake_case; use string values in HTML)
id,style(optional): strings.navlink(required): JSON string —INavLink(key,text, optionalbootstrapIcon,badge,value,type,selected).
Events
pageChange:{ page: string }— typically the linkkey.
Usage notes
- CSS parts:
li. - Styling uses Bulma inside the shadow root (buttons and tags); theme CSS variables follow Bulma’s scheme (e.g.
--bulma-link). - Include Bootstrap Icons if you use
bootstrapIconor the switch/checkbox/radio icons. - Storybook
nav_typeis a control helper; the shape lives onnavlink.type.
Minimal HTML example
<hb-sidenav-button
navlink='{"text":"Home","key":"home","bootstrapIcon":"house-door"}'
></hb-sidenav-button>