Sidebar
A collapsible navigation sidebar with labelled groups and individual items. It uses the same frosted panel surface treatment as the drawer, while still supporting icon-only collapse mode, keyboard navigation, and full ARIA compliance. On small screens it switches to a bottom tab bar plus an overlay drawer with tap-to-dismiss, a close button, and swipe-to-dismiss.
Collapsible Sidebar
Add the collapsible attribute to show the collapse control. Sidebars with a logo anchor it to the panel edge; text-only sidebars keep it inside the header so collapsed mode has no empty logo space. It uses panel-left-close when expanded and panel-left-open when collapsed. Header height and padding remain fixed across both states. Items animate to icon-only mode while their labels remain in the accessibility tree and keyboard reachable. Pair collapsed items with ore-tooltip to surface labels for sighted keyboard and pointer users.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="none"
style="height: 400px; --grid-cols: auto 1fr; border: 1px solid var(--color-contrast-200); border-radius: var(--rounded-lg); overflow: hidden;">
<ore-sidebar collapsible label="App navigation" style="grid-area: sidebar;">
<ore-icon slot="logo" name="rocket" size="24"></ore-icon>
<span slot="header">My App</span>
<ore-sidebar-group label="Main">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Dashboard
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="folder" size="18"></ore-icon>
Projects
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="settings" size="18"></ore-icon>
Settings
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<main style="grid-area: main; padding: var(--size-4);">Main content area</main>
</ore-grid>Responsive App Shell (Desktop / Tablet / Mobile)
Use two breakpoints to get the full three-state behavior:
- Desktop: full sidebar, collapsed from a navbar button (
toggle()) - Tablet: compact/collapsed sidebar (
responsive) - Mobile: bottom navigation + drawer (
bottom-nav-at), opened from the same navbar control (menu-icon="panel-left-open") and closed by backdrop tap, swipe,Escape, or the control again
The navbar owns the chrome in an app shell: the sidebar keeps no header of its own (branding lives in the navbar) and no built-in toggle (drop collapsible; the navbar button calls sidebar.toggle() instead).
<div class="sidebar-shell-preview">
<style>
.sidebar-shell-preview {
position: relative;
height: 460px;
overflow: hidden;
border: 1px solid var(--color-contrast-200);
border-radius: var(--rounded-lg);
}
.sidebar-shell-preview .shell-body {
position: relative;
height: calc(100% - var(--size-14));
overflow: hidden;
}
.sidebar-shell-preview .shell-grid {
height: 100%;
--grid-cols: auto minmax(0, 1fr);
}
.sidebar-shell-preview .shell-grid > ore-grid-item {
min-width: 0;
min-height: 0;
}
.sidebar-shell-preview .shell-sidebar {
min-height: 0;
}
.sidebar-shell-preview .shell-content {
min-width: 0;
min-height: 0;
padding: var(--size-4);
overflow: auto;
}
/* The navbar hamburger drives the drawer on mobile; the collapse toggle is desktop/tablet chrome. */
.sidebar-shell-preview ore-navbar[data-mobile] #docs-shell-toggle {
display: none;
}
/* The bottom bar floats over content; reserve its height so nothing scrolls under it. */
@media (max-width: 640px) {
.sidebar-shell-preview .shell-content {
padding-bottom: calc(var(--size-4) + var(--sidebar-bottom-nav-height, 3.75rem));
}
}
</style>
<ore-navbar
sticky
breakpoint="(max-width: 640px)"
menu-icon="panel-left-open"
mobile-sidebar="#docs-shell-sidebar"
label="Workspace navigation">
<span slot="logo" style="display: inline-flex; align-items: center; gap: var(--size-2);">
<ore-button id="docs-shell-toggle" variant="ghost" size="sm" icon-only label="Toggle sidebar">
<ore-icon id="docs-shell-toggle-icon" name="panel-left-close" size="18"></ore-icon>
</ore-button>
<span style="font-weight: var(--font-semibold);">Workspace</span>
</span>
<ore-navbar-item slot="start" href="#" active>Dashboard</ore-navbar-item>
<ore-navbar-item href="#">Projects</ore-navbar-item>
<ore-navbar-item href="#">Reports</ore-navbar-item>
<ore-navbar-item slot="end" href="#">Account</ore-navbar-item>
</ore-navbar>
<div class="shell-body">
<ore-grid class="shell-grid" areas="'sidebar main'" fullwidth gap="none">
<ore-grid-item area="sidebar">
<ore-sidebar
id="docs-shell-sidebar"
class="shell-sidebar"
container-breakpoints
label="Workspace sidebar"
responsive="(max-width: 1200px)"
bottom-nav-at="(max-width: 640px)">
<ore-sidebar-item href="#" active bottom-nav>
<ore-icon slot="icon" name="layout-dashboard" size="18"></ore-icon>
Dashboard
</ore-sidebar-item>
<ore-sidebar-item href="#" bottom-nav>
<ore-icon slot="icon" name="folder" size="18"></ore-icon>
Projects
</ore-sidebar-item>
<ore-sidebar-item href="#" bottom-nav>
<ore-icon slot="icon" name="bar-chart-3" size="18"></ore-icon>
Reports
</ore-sidebar-item>
<ore-sidebar-group label="Admin" collapsible>
<ore-sidebar-item href="#" bottom-nav bottom-nav-label="People">
<ore-icon slot="icon" name="users" size="18"></ore-icon>
Team
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="settings" size="18"></ore-icon>
Settings
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
</ore-grid-item>
<ore-grid-item area="main" class="shell-content">
<ore-text>
Resize preview width: desktop uses the full sidebar, tablet collapses it, and mobile turns navigation into
bottom tabs with a drawer. The navbar button collapses the sidebar on desktop and tablet; the navbar
hamburger opens the drawer on mobile.
</ore-text>
</ore-grid-item>
</ore-grid>
</div>
<script type="module">
const sidebar = document.getElementById('docs-shell-sidebar');
const toggle = document.getElementById('docs-shell-toggle');
const toggleIcon = document.getElementById('docs-shell-toggle-icon');
// data-collapsed is reflected on the host, so the icon also matches the
// initial state when a breakpoint collapsed the sidebar before load.
const sync = () => {
toggleIcon.setAttribute('name', sidebar.hasAttribute('data-collapsed') ? 'panel-left-open' : 'panel-left-close');
};
toggle.addEventListener('click', () => sidebar.toggle());
sidebar.addEventListener('collapsed-change', sync);
sync();
</script>
</div>Integration Notes
- By default, bottom navigation tabs are derived from direct
ore-sidebar-itemchildren. - For grouped sidebars, mark any descendant item with
bottom-navto promote it. Once one item is marked, only marked items appear in the bottom bar. - Use
bottom-nav-labelwhen the mobile tab needs a shorter label than the desktop item. - Use
labelto give an item's internal link or button an explicit accessible name, especially in collapsed icon-only navigation. ore-sidebar-groupcontent remains available in the drawer opened byopenDrawer()or a linkedore-navbar mobile-sidebartrigger.- In an app shell with a navbar, omit
collapsibleand the sidebarheader/logoslots: the navbar carries branding and its own button drivestoggle(), so the sidebar shows navigation only. Give the navbarmenu-icon="panel-left-open"and the mobile drawer control reads as the same control as the desktop one; the headerless drawer opens straight into the navigation, matching the desktop and tablet layout. - Use
responsivefor tablet compact mode andbottom-nav-atfor mobile bottom-nav mode. - The bottom bar is an overlay: give scrollable page content bottom clearance (
--sidebar-bottom-nav-height) in the mobile breakpoint so the last items are reachable.
Drawer Behavior
When the sidebar enters bottom-nav mode (or you call openDrawer()), the panel becomes an overlay: background content becomes inert and focus is trapped inside the drawer until it closes. The page behind it is left undimmed by default — a navigation drawer slides in from the edge you just tapped and is meant to be read against its content, and the panel's own elevation carries the separation. Opt into a dimming scrim with backdrop (below) when you want the modal treatment.
The drawer offers three ways to dismiss it, covering touch, pointer, and keyboard:
- Backdrop tap — clicking outside the panel closes the drawer.
- Close button — when the sidebar has header content, an
×button appears in the drawer header, in the same row position the collapse toggle holds on desktop, labelled bydrawer-close-label. A sidebar without header content (the app-shell pattern above) keeps the drawer headerless so the panel matches its desktop and tablet layout; it closes through the other routes. - Swipe — dragging the grabber nub on the panel's trailing edge past a threshold closes the drawer; releasing early snaps back.
Closing or reopening cancels an in-progress swipe and clears its visual offset. A second touch also cancels the swipe, and pinch zoom remains available over the handle. The sidebar does not claim swipes from the navigation content.
Escape also closes the drawer, and focus returns to the element that opened it. Selecting a navigation item closes the drawer by default; set close-on-select="false" to keep it open.
The backdrop is click-to-close only by default. backdrop="opaque" dims the page with the theme scrim and backdrop="blur" adds a blur behind the panel; both are built from the theme's darkening veil, so they dim in either light or dark scheme rather than inverting into a bright fog. backdrop="transparent" is the same as the default. The values match ore-drawer, whose backdrop dims by default because a dialog replaces the page rather than sliding in beside it.
<ore-sidebar bottom-nav-at="(max-width: 640px)" backdrop="blur" drawer-close-label="Close navigation">
<!-- ... -->
</ore-sidebar>In drawer-only mode the sidebar has no inline panel and no bottom bar: it exists solely as the API/navbar-driven overlay drawer, with the same backdrop, close button, and swipe behavior.
Groups
Use ore-sidebar-group to organize items into labelled sections. Add the collapsible attribute to allow toggling the group open/closed.
ore-sidebar-group uses native details/summary semantics internally: the header is a real summary, so keyboard activation (Enter/Space), focus, and the disclosed-region relationship come from the browser. Collapsible headers carry aria-expanded reflecting the real open state, and toggling an uncontrolled group emits open-change with { open }.
Set default-open="false" for uncontrolled groups that start collapsed, or pass open to control the group state externally. While open is set, the prop is the single source of truth: header clicks no longer change the state until the attribute is removed.
An uncontrolled collapsible group opens itself when one of its items is (or becomes) active, so a deep-linked page never starts with the current location folded away. It reopens only on a fresh activation: collapsing the group while its item stays active is respected. Auto-expansion emits the same open-change event as a manual toggle.
The group header takes an end slot for trailing content such as a count badge.
Use ore-sidebar-group to group semantically related items: it adds a visible label and an implicit role="list" on the items container. Avoid setting active on more than one item simultaneously, as it breaks aria-current semantics.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="none"
style="height: 400px; --grid-cols: auto 1fr; border: 1px solid var(--color-contrast-200); border-radius: var(--rounded-lg); overflow: hidden;">
<ore-sidebar label="App navigation" style="grid-area: sidebar;">
<span slot="header">My App</span>
<ore-sidebar-group label="Main">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Dashboard
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="chart-column" size="18"></ore-icon>
Analytics
</ore-sidebar-item>
</ore-sidebar-group>
<ore-sidebar-group label="Settings" collapsible open>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="user" size="18"></ore-icon>
Profile
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="bell" size="18"></ore-icon>
Notifications
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<main style="grid-area: main; padding: var(--size-4);">Content area</main>
</ore-grid>Collapsed Label Bubble
When the sidebar is collapsed to its icon rail, labels are hidden. Hovering or focusing an item then shows the label as a small bubble next to the rail. The bubble is fixed-position, so scroll containers and overflow: hidden wrappers cannot clip it, and it mirrors the reading side in RTL.
<ore-sidebar collapsible default-collapsed label="App navigation" style="height: 320px;">
<ore-sidebar-group label="Main">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Dashboard
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="chart-column" size="18"></ore-icon>
Analytics
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="user" size="18"></ore-icon>
Profile
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>Style it with --sidebar-item-reveal-bg, --sidebar-item-reveal-color, --sidebar-item-reveal-radius, and --sidebar-item-reveal-shadow. Screen readers already receive the full label from the item itself; the bubble is a sighted-user affordance and carries aria-hidden.
Items with Badges
Use the end slot on ore-sidebar-item for trailing content such as notification counts or keyboard shortcuts.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="none"
style="height: 300px; --grid-cols: auto 1fr; border: 1px solid var(--color-contrast-200); border-radius: var(--rounded-lg); overflow: hidden;">
<ore-sidebar label="App navigation" style="grid-area: sidebar;">
<ore-sidebar-group label="Mail">
<ore-badge slot="end" color="primary">16</ore-badge>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="inbox" size="18"></ore-icon>
Inbox
<ore-badge slot="end" color="primary">12</ore-badge>
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="star" size="18"></ore-icon>
Starred
<ore-badge slot="end">4</ore-badge>
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="trash-2" size="18"></ore-icon>
Trash
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<main style="grid-area: main; padding: var(--size-4);">Content area</main>
</ore-grid>Variants
Floating
Uses the same drawer-inspired panel surface with a stronger floating presentation, rounded corners, and more separation from the page background.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="sm"
style="height: 300px; --grid-cols: auto 1fr; background: var(--color-contrast-50); overflow: hidden; padding: var(--size-2);">
<ore-sidebar variant="floating" label="Floating sidebar" style="grid-area: sidebar;">
<ore-sidebar-group label="Navigation">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Home
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="folder" size="18"></ore-icon>
Files
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<div style="grid-area: main; padding: var(--size-4);">Content</div>
</ore-grid>Inset
A subtle variant with a slightly tinted background and no visible border or elevated panel shadow: blends naturally into page content areas.
<ore-grid areas="'sidebar main'" fullwidth gap="none" style="height: 300px; --grid-cols: auto 1fr; overflow: hidden;">
<ore-sidebar variant="inset" label="Inset sidebar" style="grid-area: sidebar;">
<ore-sidebar-group label="Navigation">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Home
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="folder" size="18"></ore-icon>
Files
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<div style="grid-area: main; padding: var(--size-4);">Content</div>
</ore-grid>Header and Footer Slots
Use slot="logo" for the logo/icon and slot="header" for the app name or branding text. Use slot="footer" for user profile or secondary actions. When collapsed, a supplied logo remains centered and the toggle stays on the panel edge. Without a logo, the toggle occupies the header itself.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="none"
style="height: 400px; --grid-cols: auto 1fr; border: 1px solid var(--color-contrast-200); border-radius: var(--rounded-lg); overflow: hidden;">
<ore-sidebar label="App sidebar" style="grid-area: sidebar;">
<ore-icon slot="logo" name="rocket" size="24"></ore-icon>
<span slot="header">MyApp</span>
<ore-sidebar-group label="Navigation">
<ore-sidebar-item href="#" active>
<ore-icon slot="icon" name="home" size="18"></ore-icon>
Dashboard
</ore-sidebar-item>
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="users" size="18"></ore-icon>
Team
</ore-sidebar-item>
</ore-sidebar-group>
<div
slot="footer"
style="display: flex; align-items: center; gap: var(--size-2); font-size: var(--text-sm); color: var(--color-contrast-600);">
<ore-sidebar-item href="#">
<ore-icon slot="icon" name="settings" size="18"></ore-icon>
Config
</ore-sidebar-item>
</div>
</ore-sidebar>
<main style="grid-area: main; padding: var(--size-4);">Content area</main>
</ore-grid>Disabled Items
Set disabled on a ore-sidebar-item to prevent interaction. Avoid using disabled as a teaching mechanism: if an item is permanently unavailable, remove it from the sidebar instead.
<ore-grid
areas="'sidebar main'"
fullwidth
gap="none"
style="--grid-cols: auto 1fr; border: 1px solid var(--color-contrast-200); border-radius: var(--rounded-lg); overflow: hidden;">
<ore-sidebar label="App navigation" style="grid-area: sidebar;">
<ore-sidebar-group label="Options">
<ore-sidebar-item href="/available">
<ore-icon slot="icon" name="check-circle" size="18"></ore-icon>
Available
</ore-sidebar-item>
<ore-sidebar-item href="/locked" disabled>
<ore-icon slot="icon" name="lock" size="18"></ore-icon>
Locked (disabled)
</ore-sidebar-item>
</ore-sidebar-group>
</ore-sidebar>
<main style="grid-area: main; padding: var(--size-4);">Content area</main>
</ore-grid>External Links
When linking to external resources, use target and rel attributes on ore-sidebar-item.
<ore-sidebar-item href="https://example.com" target="_blank" rel="noopener noreferrer">
<ore-icon slot="icon" name="globe" size="18"></ore-icon>
External Docs
</ore-sidebar-item>Imperative API
Collapse methods are exposed on the element instance.
const sidebar = document.querySelector('ore-sidebar');
sidebar.setCollapsed(true); // collapse to icon-only
sidebar.setCollapsed(false); // expand to full width
sidebar.toggle(); // toggle between states
// bottom-nav mode drawer controls
sidebar.openDrawer();
sidebar.closeDrawer();
sidebar.toggleDrawer();Events
const sidebar = document.querySelector('ore-sidebar');
sidebar.addEventListener('collapsed-change', (e) => {
console.log('Collapsed:', e.detail.collapsed, 'source:', e.detail.source);
});
sidebar.addEventListener('drawer-change', (e) => {
console.log('Drawer open:', e.detail.open, 'source:', e.detail.source);
});
const group = document.querySelector('ore-sidebar-group[collapsible]');
group.addEventListener('open-change', (e) => {
console.log('Group open:', e.detail.open);
});Related Components
Recipes
Section dividers
Drop an ore-separator between groups for a plain rule instead of a labelled heading:
<ore-sidebar label="App navigation">
<ore-sidebar-group label="Workspace">…</ore-sidebar-group>
<ore-separator></ore-separator>
<ore-sidebar-group label="Account">…</ore-sidebar-group>
</ore-sidebar>Featured footer card
The footer slot fits a compact card: upgrade CTAs, usage progress, or a scan-to-install QR. Keep the card narrow: it lives inside the sidebar's width.
<ore-sidebar label="App navigation">
<ore-sidebar-group label="Workspace">…</ore-sidebar-group>
<ore-card slot="footer" padding="sm" variant="outlined">
<p style="font-weight: var(--font-semibold);">Try Pro</p>
<p style="font-size: var(--text-sm); color: var(--text-color-secondary);">Unlimited boards and guests.</p>
<ore-progress value="62" aria-label="Boards used"></ore-progress>
<ore-button variant="primary" size="sm" fullwidth>Upgrade</ore-button>
</ore-card>
</ore-sidebar>Scan-to-install pairs nicely with ore-qr-code:
<ore-qr-code
slot="footer"
value="https://example.test/install"
size="112"
error-correction="H"
image="/favicon.svg"
variant="card"></ore-qr-code>CSS Customization
Global Variables
Override these CSS custom properties in your stylesheet to restyle the sidebar globally:
ore-sidebar {
--sidebar-width: 18rem; /* expanded width */
--sidebar-collapsed-width: 4rem; /* collapsed width */
--sidebar-bg: var(--color-canvas); /* sidebar background */
--sidebar-border-color: var(--color-divider);
}
ore-sidebar-item {
--sidebar-item-color: var(--color-contrast-700);
--sidebar-item-hover-bg: var(--color-contrast-100);
--sidebar-item-hover-color: var(--color-contrast-900);
--sidebar-item-active-bg: color-mix(in oklch, var(--color-primary) 12%, transparent);
--sidebar-item-active-color: var(--color-primary);
}API Reference
ore-sidebar Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
collapsed | boolean | N/A | Controlled collapsed state |
default-collapsed | boolean | false | Initial collapsed state in uncontrolled mode |
collapsible | boolean | false | Shows the collapse/expand toggle button in the header |
responsive | string | N/A | Media query that enables compact (collapsed) sidebar mode |
bottom-nav-at | string | N/A | Media query that switches to mobile bottom-nav + drawer mode |
container-breakpoints | boolean | false | Evaluates parseable max-width breakpoints against the sidebar container width instead of the viewport |
backdrop | string | N/A | Drawer backdrop style: 'opaque' | 'blur' | 'transparent' (unset = click-to-close, no dim) |
close-on-select | boolean | true | Closes the drawer after primary item activation |
collapse-label | string | 'Collapse sidebar' | Accessible label for the collapse control |
expand-label | string | 'Expand sidebar' | Accessible label for the expand control |
drawer | boolean | false | Drawer-only mode: the sidebar exists solely as the overlay drawer |
drawer-close-label | string | 'Close sidebar' | Accessible label for the drawer close button |
variant | string | N/A | Visual variant: 'floating' | 'inset' |
label | string | 'Sidebar navigation' | aria-label for the <nav> landmark |
ore-sidebar Slots
| Slot | Description |
|---|---|
logo | Logo or icon, always visible at the top |
header | App name or branding text, hidden when collapsed |
| (default) | ore-sidebar-group or ore-sidebar-item elements |
footer | User info, theme toggles, or secondary actions |
ore-sidebar Events
| Event | Detail | Description |
|---|---|---|
collapsed-change | { collapsed: boolean; source: 'toggle' | 'responsive' | 'api' } | Fired when a collapse state change is requested |
drawer-change | { open: boolean; source: 'toggle' | 'responsive' | 'api' } | Fired when the drawer open state changes |
ore-sidebar Methods
| Method | Description |
|---|---|
setCollapsed(next) | Set collapsed state |
toggle() | Toggle between collapsed / expanded |
openDrawer() | Open the drawer |
closeDrawer() | Close the drawer |
toggleDrawer() | Toggle the drawer |
ore-sidebar CSS Custom Properties
| Property | Description | Default |
|---|---|---|
--sidebar-width | Expanded width | 16rem |
--sidebar-collapsed-width | Collapsed (icon-only) width | 3.5rem |
--sidebar-bg | Sidebar background color | canvas |
--sidebar-border-color | Border / divider color | contrast |
--sidebar-header-height | Header height in both states | 4rem |
--sidebar-header-padding | Header padding in both states | 0.75rem |
--sidebar-z-index | Sidebar stacking level | 1 |
--sidebar-toggle-offset | Toggle offset from the top | 1rem |
--sidebar-toggle-bg | Toggle background | panel |
--sidebar-toggle-color | Toggle icon color | contrast |
--sidebar-toggle-border-color | Toggle border color | divider |
--sidebar-toggle-hover-bg | Toggle hover background | contrast |
--sidebar-toggle-hover-color | Toggle hover icon color | contrast |
--sidebar-drawer-width | Open drawer panel width | min(--sidebar-width, 85vw) |
--sidebar-drawer-backdrop-bg | Drawer backdrop color | transparent (--overlay-veil in the dimming modes) |
--sidebar-drawer-shadow | Shadow on the open drawer panel | --shadow-xl |
--sidebar-bottom-nav-height | Bottom bar height | 3.75rem |
ore-sidebar Parts
| Part | Description |
|---|---|
nav | The navigation panel (inline and drawer) |
header | Header container (logo, branding, controls) |
content | Scrollable navigation content |
footer | Footer container |
toggle-btn | Collapse/expand toggle |
drawer-close-btn | Close button shown while the drawer is open |
drawer-backdrop | Backdrop behind the open drawer (click closes it; dims only with backdrop) |
swipe-handle | Grabber nub that drag-closes the open drawer |
bottom-bar | Mobile bottom tab bar |
ore-sidebar-group Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
label | string | '' | Visible group label text |
collapsible | boolean | false | Adds a toggle button to collapse/expand the group's items |
default-open | boolean | true | Initial open state for uncontrolled collapsible groups |
open | boolean | N/A | Controlled group open state |
ore-sidebar-group Slots
| Slot | Description |
|---|---|
icon | Optional icon displayed in the group header |
| (default) | ore-sidebar-item elements |
end | Trailing header content: badge, count, shortcut, etc. |
ore-sidebar-group Events
| Event | Detail | Description |
|---|---|---|
open-change | { open: boolean } | Fired when an uncontrolled collapsible group opens or closes, including auto-expansion for an active item |
ore-sidebar-item Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
href | string | N/A | URL: renders an <a> when set, otherwise a <button> |
active | boolean | false | Marks the item as the current page (aria-current="page") |
bottom-nav | boolean | false | Promotes the item into an explicit mobile bottom-nav set |
bottom-nav-label | string | N/A | Overrides the item text in its promoted mobile tab |
disabled | boolean | false | Disables the item and forces button rendering |
rel | string | N/A | rel attribute on the inner <a> (link items only) |
target | string | N/A | target attribute on the inner <a> (link items only) |
ore-sidebar-item Slots
| Slot | Description |
|---|---|
icon | Leading icon (hidden from assistive tech) |
| (default) | Item label text |
end | Trailing content: badge, shortcut key, chevron, etc. |
ore-sidebar-item Parts
| Part | Description |
|---|---|
item | The inner <a> or <button> element |
item-icon | The icon slot wrapper |
item-label | The label text wrapper |
item-end | The trailing content wrapper |
item-reveal | Collapsed-mode label bubble |
ore-sidebar-item CSS Custom Properties
| Property | Description |
|---|---|
--sidebar-item-color | Default text color |
--sidebar-item-hover-bg | Background on hover |
--sidebar-item-hover-color | Text color on hover |
--sidebar-item-active-bg | Background when active |
--sidebar-item-active-color | Text color when active |
--sidebar-item-reveal-bg | Label bubble background |
--sidebar-item-reveal-color | Label bubble text color |
--sidebar-item-reveal-radius | Label bubble corner radius |
--sidebar-item-reveal-shadow | Label bubble shadow |
Accessibility
The sidebar follows WAI-ARIA navigation patterns and WCAG 2.2 guidelines.
The ore-sidebar element renders a <nav> landmark with an aria-label. When a page has multiple navigation regions, ensure each has a unique descriptive label:
<ore-sidebar label="Main navigation">…</ore-sidebar> <ore-sidebar label="Documentation sidebar">…</ore-sidebar>ore-sidebar-item sets aria-current="page" on the inner <a> or <button> when active is applied. Screen readers announce the item as the current location. Set active on the item matching the current URL on every page load, and avoid setting it on more than one item simultaneously.
When the sidebar is collapsed to icon-only mode, the toggle button updates aria-label and aria-expanded to reflect the current state, and each item reveals its hidden label in a bubble on hover and keyboard focus, so icon-only navigation stays legible without assistive tech. Navigation within the sidebar uses native DOM focus order: no roving tabindex: keeping behaviour predictable and compatible with all screen readers.
Keyboard Navigation
| Key | Behavior |
|---|---|
Tab | Moves focus to the next focusable item in DOM order |
Enter | Activates a focused item or toggles a collapsible header |
Space | Same as Enter on collapsible group headers |
Escape | Closes the open drawer and returns focus to the opener |
While the drawer is open, the rest of the page is inert: Tab cannot leave the drawer, and focus is pulled back to the panel if it escapes.