Xzero UI
Pro library

Sidebar railPro

An app shell whose sidebar folds into an icon rail and slides in as a sheet on phones.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/sidebar-rail
Live · keyboard ready

Variant: App rail

An app shell whose sidebar folds into an icon rail and slides in as a sheet on phones.

Use this as the frame of a product app. Map the sections to your routes, send selection to your router, and persist the collapsed state per person; press [ to fold the rail.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/sidebar-rail

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { SidebarRail } from "@/components/xzero/blocks/sidebar-rail/sidebar-rail";

export default function AppShell() {
  return (
    <main>
      <SidebarRail />
    </main>
  );
}

API reference

SidebarRail

An app shell with a sidebar that folds into an icon rail, nested nav groups, breadcrumbs, and a sheet on narrow widths. Sections and page content are sample data.

No props.

Keyboard interactions

KeysAction
[Folds or unfolds the rail when focus is not in a text field, menu, or dialog.
EscapeCloses the navigation sheet on narrow widths.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Related

Browse all components