A CSS sidebar layout is a page shell with a vertical column for navigation, filters, or contextual controls beside the main content. These 23 hand-coded layouts are ready-to-ship sidebars for dashboards, documentation, e-commerce filters, and admin tools — copy the markup, point links at your routes, and ship.
23 unique layouts21 Pure CSS2 CSS + JS100% copy-paste readyPublished
01 / 23
Fixed Sidebar
Pure CSS
Apple-Pro premium — brushed-aluminium sidebar on a near-black slate, system-blue accents and SF-style typography.
A sidebar layout is a page shell with a vertical navigation column docked beside the main content. It's the default structure for admin dashboards, mail clients, IDEs, documentation sites, and any app where users need persistent navigation that doesn't compete with the work surface.
When should I use a fixed sidebar vs an off-canvas drawer?
Use a fixed sidebar on desktop when navigation is used constantly (admin dashboards, IDEs, mail). Use an off-canvas drawer on mobile or for apps where the user spends most of their time in the main content (reading apps, single-task tools). Many production apps use both — fixed at ≥1024px, drawer below.
How do I make a sidebar accessible?
Wrap it in <aside aria-label="Primary"> not a <div>. Use <nav> with a real <ul><li><a> list, mark the active link with aria-current="page", and use <button type="button" aria-expanded aria-controls> for any toggle. For nested submenus, prefer native <details>/<summary> — the browser handles keyboard, ARIA, and Enter/Space for free.
Pure CSS or JavaScript for the toggle?
Pure CSS first, via a hidden checkbox + :has(:checked). It works without JS and is bulletproof. Add JavaScript only when you genuinely need it — to persist state across reloads (localStorage), to close the drawer on route change, or to trap focus inside an open dialog. The persistent collapsible demo shows the JS pattern when you do need it.
How do I keep the sidebar from overlapping content on mobile?
Switch the layout below 720 px. The simplest approach is a CSS grid that goes from `grid-template-columns: 240px 1fr` (desktop) to `1fr` (mobile), with the sidebar stacking above the main content — every demo here ships that fallback. If you need a true overlay drawer at small widths, use the off-canvas pattern (demo 03) — it captures pointer events on the backdrop so taps outside dismiss it.