Side Panel
<dsx-side-panel> — Side Panel
Section titled “<dsx-side-panel> — Side Panel”Persistent navigation/content rail that can collapse down to a slim toggle strip.
Live Preview
Import
Section titled “Import”import '@bnotk/dsx/components/side-panel.js';<dsx-side-panel> <nav> <a href="#">Dashboard</a> </nav></dsx-side-panel>Elements
Section titled “Elements”<dsx-side-panel>
Section titled “<dsx-side-panel>”Collapsible side rail with built-in toggle button and scrollable content region.
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
| open | boolean | true | Expands the panel to its full width when true. |
| collapsible | boolean | true | Shows or hides the built-in toggle button. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
| toggle() | Toggles open and emits dsx-toggle with the new state. |
Events
Section titled “Events”| Event | Detail | Description |
|---|---|---|
| dsx-toggle | { open: boolean } | Bubbles/composed whenever toggle() changes the panel state. |
| Slot | Description |
|---|---|
| default | Panel content rendered inside the scrollable .content region. |
CSS Parts
Section titled “CSS Parts”This element does not expose shadow parts.
- When
openis false the host width shrinks to3remand the content region is hidden withdisplay: none. - If
collapsibleis false there is no built-in button, but the publictoggle()method still exists.
Behavior Notes
Section titled “Behavior Notes”- The full width defaults to
var(--ds2-sidepanel-width, 19.25rem). - The toggle button label changes between
◀and▶and updates itsaria-labelbetween “Collapse” and “Expand”.
Styling Notes
Section titled “Styling Notes”- The panel uses a white surface, right-hand grey divider, and transition driven by
--ds2-transition-base. - The content region itself is scrollable.