Skip to content

SidebarRail on a phone

The same sidebar in a 24 rem frame, so the layout switches to the menu button and the drawer. Open the menu: the sections are the first screen, a section is the second, and a page with children opens the next screen, each with a back row that names where it returns to. Nothing expands in place.

  • SidebarRail

PreviewLink to the section Preview

Live in all three themes. Everything here is interactive.

Light theme, SidebarRail on a phone

Skip to contentSkip to navigation

Variants

The rail is compact. Point at Commerce: its panel opens to the side; point at Products and its pages open one level further to the side, lined up with the row. The pin docks the panel beside the content. Narrow the window for the phone drawer, where each level is a screen.

#/commerce/products/variants

Dark theme, SidebarRail on a phone

Skip to contentSkip to navigation

Variants

The rail is compact. Point at Commerce: its panel opens to the side; point at Products and its pages open one level further to the side, lined up with the row. The pin docks the panel beside the content. Narrow the window for the phone drawer, where each level is a screen.

#/commerce/products/variants

High contrast theme, SidebarRail on a phone

Skip to contentSkip to navigation

Variants

The rail is compact. Point at Commerce: its panel opens to the side; point at Products and its pages open one level further to the side, lined up with the row. The pin docks the panel beside the content. Narrow the window for the phone drawer, where each level is a screen.

#/commerce/products/variants

UsageLink to the section Usage

tsx
import { SidebarRail } from '@skribly/ui/shell'
tsx
<SidebarRail sections={sections} current={pathname}
  labels={{ …, back: 'All sections', backTo: (label) => `Back to ${label}` }} />

Every label is a prop, so the app passes its own words in its own language. See no built-in text.

AccessibilityLink to the section Accessibility

  • The menu button opens a modal drawer: focus moves in, stays in, and returns to the menu button on Escape.
  • Only the top screen can be reached; the ones under it are inert.
  • A new screen slides in over 180 ms, or appears at once under reduced motion.
  • A row with a chevron opens the next screen.
  • The back row is named by backTo, such as "Back to Commerce".
  • The drawer opens on the screen of the open page.

This demo runs through axe in all three themes on every test run. See what the tests check.

Search this site

Arrows move through the results, Enter opens one, Esc closes. Ctrl K /