Sidebar
Collapsible navigation sidebar with grouped sections, heading labels, and active link highlighting. Ideal for documentation sites, admin panels, and any layout that needs persistent vertical navigation.
<arc-sidebar> Overview
>
Sidebar provides a structured vertical navigation panel that organizes links into collapsible, headed sections. It is the standard way to present multi-level navigation in documentation sites, admin dashboards, settings panels, and any application where the user needs to move between many related pages without losing context.
Each SidebarSection groups links under an optional heading, creating a clear visual hierarchy that mirrors your information architecture. The active prop on SidebarLink highlights the current page, giving users an immediate sense of where they are within the navigation tree. Sections can be expanded or collapsed to keep long navigation lists manageable.
Sidebar is designed to sit inside an AppShell or PageLayout, typically occupying the left rail. It reads the full viewport height by default and scrolls independently of the main content area, so deep navigation trees remain accessible even on long pages. Pair it with TopBar for a complete application chrome.Guidelines
When to use
- Group related links under a SidebarSection with a descriptive heading
- Set the active prop on the link that matches the current route
- Keep section headings short — one to three words that name the category
- Place the Sidebar inside an AppShell or PageLayout for consistent layout
- Use a Drawer to present the Sidebar on narrow viewports
- Order sections by importance or frequency of use, most common first
When not to use
- Do not nest Sidebars inside each other — use sections and indentation instead
- Do not mark more than one link as active at the same time
- Do not use Sidebar for top-level site-wide navigation — prefer TopBar for that role
- Do not add more than eight to ten links per section; split large groups into sub-sections
- Do not omit headings on sections — unlabeled groups make navigation harder to scan
- Do not place actions (buttons, toggles) inside the Sidebar — it is for navigation links only
Features
- Collapsible sections with heading labels for grouped navigation
- Active link highlighting to indicate the current page
- Independent scroll region for deep navigation trees
- Composable with SidebarSection and SidebarLink sub-components
- Keyboard navigable with focus-visible indicators on every link
- Designed to integrate with AppShell and PageLayout for full-page chrome
- Responsive-ready — pairs with Drawer for mobile breakpoints
- Token-driven theming for background, border, and active-link colors
Preview
Usage
Layout and styling work without JavaScript via the HTML/CSS versions. Interactive features like events and state management require the Web Component or a framework wrapper.
<script type="module" src="@arclux/arc-ui"></script>
<arc-sidebar>
<arc-sidebar-section heading="Guide">
<arc-sidebar-link href="/docs/getting-started">Getting Started</arc-sidebar-link>
<arc-sidebar-link href="/docs/tokens">Design Tokens</arc-sidebar-link>
<arc-sidebar-link href="/docs/theming" active>Theming</arc-sidebar-link>
</arc-sidebar-section>
<arc-sidebar-section heading="Components">
<arc-sidebar-link href="/docs/components/button">Button</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/card">Card</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/modal">Modal</arc-sidebar-link>
</arc-sidebar-section>
</arc-sidebar> import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-react';
export function DocsSidebar() {
return (
<Sidebar>
<SidebarSection heading="Guide">
<SidebarLink href="/docs/getting-started">Getting Started</SidebarLink>
<SidebarLink href="/docs/tokens">Design Tokens</SidebarLink>
<SidebarLink href="/docs/theming" active>Theming</SidebarLink>
</SidebarSection>
<SidebarSection heading="Components">
<SidebarLink href="/docs/components/button">Button</SidebarLink>
<SidebarLink href="/docs/components/card">Card</SidebarLink>
<SidebarLink href="/docs/components/modal">Modal</SidebarLink>
</SidebarSection>
</Sidebar>
);
} <script setup>
import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-vue';
</script>
<template>
<Sidebar>
<SidebarSection heading="Guide">
<SidebarLink href="/docs/getting-started">Getting Started</SidebarLink>
<SidebarLink href="/docs/tokens">Design Tokens</SidebarLink>
<SidebarLink href="/docs/theming" active>Theming</SidebarLink>
</SidebarSection>
<SidebarSection heading="Components">
<SidebarLink href="/docs/components/button">Button</SidebarLink>
<SidebarLink href="/docs/components/card">Card</SidebarLink>
<SidebarLink href="/docs/components/modal">Modal</SidebarLink>
</SidebarSection>
</Sidebar>
</template> <script>
import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-svelte';
</script>
<Sidebar>
<SidebarSection heading="Guide">
<SidebarLink href="/docs/getting-started">Getting Started</SidebarLink>
<SidebarLink href="/docs/tokens">Design Tokens</SidebarLink>
<SidebarLink href="/docs/theming" active>Theming</SidebarLink>
</SidebarSection>
<SidebarSection heading="Components">
<SidebarLink href="/docs/components/button">Button</SidebarLink>
<SidebarLink href="/docs/components/card">Card</SidebarLink>
<SidebarLink href="/docs/components/modal">Modal</SidebarLink>
</SidebarSection>
</Sidebar> import { Component } from '@angular/core';
import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-angular';
@Component({
imports: [Sidebar, SidebarSection, SidebarLink],
template: `
<arc-sidebar>
<arc-sidebar-section heading="Guide">
<arc-sidebar-link href="/docs/getting-started">Getting Started</arc-sidebar-link>
<arc-sidebar-link href="/docs/tokens">Design Tokens</arc-sidebar-link>
<arc-sidebar-link href="/docs/theming" active>Theming</arc-sidebar-link>
</arc-sidebar-section>
<arc-sidebar-section heading="Components">
<arc-sidebar-link href="/docs/components/button">Button</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/card">Card</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/modal">Modal</arc-sidebar-link>
</arc-sidebar-section>
</arc-sidebar>
`,
})
export class DocsSidebarComponent {} import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-solid';
export function DocsSidebar() {
return (
<Sidebar>
<SidebarSection heading="Guide">
<SidebarLink href="/docs/getting-started">Getting Started</SidebarLink>
<SidebarLink href="/docs/tokens">Design Tokens</SidebarLink>
<SidebarLink href="/docs/theming" active>Theming</SidebarLink>
</SidebarSection>
<SidebarSection heading="Components">
<SidebarLink href="/docs/components/button">Button</SidebarLink>
<SidebarLink href="/docs/components/card">Card</SidebarLink>
<SidebarLink href="/docs/components/modal">Modal</SidebarLink>
</SidebarSection>
</Sidebar>
);
} import { Sidebar, SidebarSection, SidebarLink } from '@arclux/arc-ui-preact';
export function DocsSidebar() {
return (
<Sidebar>
<SidebarSection heading="Guide">
<SidebarLink href="/docs/getting-started">Getting Started</SidebarLink>
<SidebarLink href="/docs/tokens">Design Tokens</SidebarLink>
<SidebarLink href="/docs/theming" active>Theming</SidebarLink>
</SidebarSection>
<SidebarSection heading="Components">
<SidebarLink href="/docs/components/button">Button</SidebarLink>
<SidebarLink href="/docs/components/card">Card</SidebarLink>
<SidebarLink href="/docs/components/modal">Modal</SidebarLink>
</SidebarSection>
</Sidebar>
);
} <arc-sidebar>
<arc-sidebar-section heading="Guide">
<arc-sidebar-link href="/docs/getting-started">Getting Started</arc-sidebar-link>
<arc-sidebar-link href="/docs/tokens">Design Tokens</arc-sidebar-link>
<arc-sidebar-link href="/docs/theming" active>Theming</arc-sidebar-link>
</arc-sidebar-section>
<arc-sidebar-section heading="Components">
<arc-sidebar-link href="/docs/components/button">Button</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/card">Card</arc-sidebar-link>
<arc-sidebar-link href="/docs/components/modal">Modal</arc-sidebar-link>
</arc-sidebar-section>
</arc-sidebar> <!-- arc-sidebar is hybrid — CSS handles layout, JS enhances interactivity -->
<arc-sidebar></arc-sidebar> API
-
activestring'' - The href of the currently active sidebar link. Used to highlight the matching link with accent styling.
-
collapsedbooleanfalse - When true, collapses the sidebar to icon-only mode, hiding labels and reducing width.
-
position'left' | 'right''left' - Controls which side the sidebar appears on. Moves the border line to the opposite edge.
-
widthstring'280px' - Width of the sidebar. Accepts any CSS length value.
-
glowbooleanfalse - Enables an accent glow effect on the active sidebar link for enhanced visual emphasis.
-
labelstring'Sidebar navigation'
Events
-
arc-navigate - Fired when a sidebar link is clicked
See Also
- Navigation Menu Horizontal navigation bar with hover-triggered dropdown sub-menus and full keyboard accessibility. Designed for marketing sites, documentation hubs, and product landing pages where top-level sections expand into categorised link lists.
- Drawer Slide-out panel with backdrop overlay, keyboard dismissal, and left/right positioning for off-canvas navigation, filters, and detail views.
- App Shell Full-page layout scaffold that composes a TopBar, Sidebar, and scrollable content area into a cohesive application frame. Handles responsive collapse, sidebar toggling, and optional table-of-contents rail out of the box.
- Top Bar Fixed header bar that anchors every page with a brand slot on the left, an optional center navigation area, and a right-aligned actions region for user controls, search, and settings.