FixedSidebar
LayoutLive DemoAnatomyComponentsInteractionsRules
←StyleKit
Layout Pattern — Fixed Sidebar

Persistent nav.
Maximum focus.

Fixed sidebar navigation keeps every key action permanently accessible while the main content area scrolls freely. Built for dashboards, admin panels, doc sites, and SaaS apps.

Desktop 1024px+
Sidebar: w-64 fixed
Content: ml-64
Tablet 768px
Sidebar: w-16 icons
Content: ml-16
Mobile <768px
Sidebar: off-canvas
Content: full-width
Interactive

Live sidebar demo

Click nav items to switch active state. Toggle desktop/mobile view. Open and close the sidebar to see collapse behavior.

AppKit
Main
Content
System
JD
John Doe
Admin
HomeDashboard

Dashboard

Total Revenue
$84,320
+12.4%
Active Users
12,456
+8.1%
Orders
1,893
-2.3%
Uptime
99.98%
+0.02%
Recent Activity
New user registered
Order #1042 processed
Report generated
Anatomy

Sidebar structure

Five vertical zones from top to bottom, each with a clear responsibility. The navigation zone is the only scrollable area.

Logo / Brand
Search
Navigation (scrollable)
Secondary / Settings
User Profile
Header Bar
Main Content Area
w-64 = 256px(or w-72 = 288px for wider variant)
01
Logo / Brand

Fixed height header with product logo and optional workspace switcher. Sets the brand context immediately.

height: 64–80px, border-bottom, flex items-center
02
Search (optional)

Quick-access search input. Visible only when sidebar is expanded. Hides in collapsed icon-only mode.

height: 52–60px, focus:ring-2 focus:ring-blue-400/30
03
Navigation

The primary scrollable zone. Groups related items with section labels. Current item has solid left accent line.

flex-1, overflow-y-auto, space-y-1 per group
04
Secondary / Settings

Lower-priority links: Help, Feedback, Settings. Separated visually to avoid navigation confusion.

border-top, space-y-1, muted colors
05
User Profile

Avatar, name, and role. May include account menu or logout action. Always anchored to the very bottom.

border-top, height: 64–72px, flex items-center gap-3
Components

Component gallery

The four core building blocks of a fixed sidebar layout, each demonstrated with interactive states.

Active state — solid anchor
Dashboard
Analytics
Users3
Settings

Active item: bg-blue-50 text-blue-700 with absolute left-0 w-0.5 bg-blue-600 accent line. Stable, not floating.

Collapsed — icons only (w-16)

Collapsed to w-16 = 64px. Labels hidden, icons centered. Active line persists.

Interactions

Animation rules demo

Four named interaction rules that govern all sidebar layout behavior. Hover or click each demo card to feel the constraint in action.

Frictionless Utility

duration-150 — no overshot spring

High-interaction areas like nav items use duration-150 for instant response. Fancy spring effects break workflow rhythm.

CORRECT 150ms
WRONG 700ms

Hover both rows — feel the efficiency difference. Nav items must never feel sluggish.

Magnetic Icon Shift

translate-x-0.5 on hover

On hover, icons shift 2px right. The micro-movement guides the eye toward the main content area — directional affordance without noise.

Dashboard
Analytics
Users
Settings
Solid Active State

left accent line — stable anchor

Current item has a solid 2px left border as a permanent anchor. No floating ring, no glow — the user always knows exactly where they are.

Click to change active item — the left line anchors instantly.

Content Lift

-translate-y-0.5 + lightweight shadow

Main area cards lift by only 2px on hover with a subtle shadow spread. Reading stays stable — no dramatic jumps that interrupt scanning.

CORRECT
Correct
Subtle lift
WRONG
Wrong
Too dramatic

Hover both cards side by side — the left card is barely perceptible, the right is jarring. Use the left approach.

Design Rules

Do & Don't

The non-negotiable constraints that define the Fixed Sidebar layout. Every rule exists to protect usability and developer confidence.

Do

  • Sidebar: fixed top-0 left-0 w-64 h-screen
  • Main content: ml-64 (matches sidebar width)
  • Mobile: off-canvas drawer with hamburger trigger
  • Active state: left accent line or bold bg tint
  • Nav overflow: sidebar nav scrollable if needed
  • Sidebar width: w-64 (256px) or w-72 (288px)
  • Nav interactions: duration-150, no spring
  • Icon hover: translate-x-0.5 (2px magnetic shift)
  • Card hover: -translate-y-0.5 and light shadow only
  • Sidebar: always includes logo, nav, user profile

Don't

  • Sidebar too wide (never exceed 280px)
  • Keep sidebar expanded on mobile
  • Omit current page indicator from nav
  • Use floating rings or glow for active state
  • Allow sidebar content to overflow without scroll
  • Use bounce, rotation, or spring on nav items
  • Create nav hierarchies deeper than 2 levels
  • Apply -translate-y-2 or more on card hover
  • Use duration-700+ on high-frequency interactions
  • Forget the mobile overlay when sidebar opens
Quick reference — key CSS values
Sidebar width
w-64 (256px)
Content offset
ml-64
Nav transition
duration-150
Icon shift
translate-x-0.5
Active line
w-0.5 left-0
Card lift
-translate-y-0.5
Card shadow
rgba(15,23,42,0.08)
Mobile z-index
z-40
FixedSidebar

Persistent navigation. Maximum content focus. The canonical layout for dashboards, admin panels, and SaaS products.

StyleDocumentationShowcaseCover
StyleKitHomeAll Styles
ColorsSlate DarkBlueEmeraldAmber
Built for StyleKit·Fixed Sidebar Layout Pattern
←Back to StyleKit