Skip to content

Side panel rail

Pro

A strip of icon links or buttons at the end edge of the window that hides to a small tab. Not an M3 component (@windmorph/react-pro).

import { SidePanelRail, SidePanelRailItem } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Props

By name or description, across the 28 props below

SidePanelRail 15 props

  • childrentype ReactNodeRequired

    SidePanelRailItem elements.

  • opentype boolean

    Whether the strip is open (controlled).

  • defaultOpentype booleandefault true

    Whether the strip starts open (uncontrolled).

  • hideBelowtype false | "medium" | "expanded" | "large"default "medium"

    Below this window size the strip is not shown. false always shows it.

  • toggleIcontype ReactElement<unknown, string | JSXElementConstructor<any>>

    Replaces the toggle's chevron; it should point to the end edge.

  • reftype Ref<HTMLElement>

    Ref to the outermost element.

  • idtype string

    The outermost element's id.

  • roletype stringdefault navigation

    The outermost element's role, e.g. group when every item is a button.

Events

  • onOpenChangetype ((open: boolean) => void)

    Called when a person hides or shows the strip.

Text

  • labelstype Partial<SidePanelRailLabels>

    Words the rail announces, with English defaults. A LabelsProvider sets them for the whole app.

  • aria-labeltype string

    One of aria-label or aria-labelledby is required.

  • aria-labelledbytype string

    One of aria-label or aria-labelledby is required.

SidePanelRailItem 13 props

  • icontype ReactElement<unknown, string | JSXElementConstructor<any>>Required

    The item's icon.

  • childrentype stringRequired

    The item's name, shown in its tooltip.

  • hreftype string

    Makes the item a link to this address.

  • currenttype booleandefault false

    Marks the link to the page the app is on (aria-current="page").

  • selectedtype booleandefault false

    Marks the button whose sheet or panel is open (aria-pressed).

  • targettype HTMLAttributeAnchorTarget

    Where the link opens.

  • reltype string

    The link's relationship to this page.

  • reftype Ref<HTMLAnchorElement> | Ref<HTMLButtonElement>

    Ref to the link.

  • disabledtype booleandefault false

    Whether the item can be used.

  • idtype string

    The button's or link's id.

Events

  • onPresstype (() => void)

    Called on a press.

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • Links and buttons, hiding to a tab

    Built

    Configuration · Basic

  • Opening a standard side sheet (selected)

    Built

    Use case · With sheet

  • Controlled by the app (open, onOpenChange)

    Built

    Configuration · Controlled

Theming & tokens

Set the tokens below on the strip or any ancestor. Its items and toggle keep the IconButton's own tokens. Style each part with classNames: root, clip, items, item, indicator, tab, toggle, chevron.

SidePanelRail tokens
VariableDefaultPaints
--wm-side-panel-rail-width56pxThe strip’s width while open.
--wm-side-panel-rail-hidden-width16pxThe gutter left while hidden.
--wm-side-panel-rail-items-gap8pxThe space between items.
--wm-side-panel-rail-items-padding-top4pxThe space above the first item.
--wm-side-panel-rail-toggle-size40pxThe toggle’s width and height while open.
--wm-side-panel-rail-toggle-inset8pxThe toggle’s distance from the end edge while open, and from the bottom.
--wm-side-panel-rail-tab-width24pxThe tab’s width at rest.
--wm-side-panel-rail-tab-hover-width48pxThe tab’s width under a pointer.
--wm-side-panel-rail-tab-height40pxThe tab’s height.
--wm-side-panel-rail-tab-touch-size48pxThe tab’s width and height on a touch screen.
--wm-side-panel-rail-tab-colorvar(--md-sys-color-secondary-container)The tab’s fill.
--wm-side-panel-rail-tab-icon-colorvar(--md-sys-color-on-secondary-container)The chevron on the tab.
--wm-side-panel-rail-tab-cornervar(--md-sys-shape-corner-full)The tab’s corners on its start side, and the open toggle’s.
--wm-side-panel-rail-chevron-size24pxThe chevron.
--wm-side-panel-rail-chevron-rest-center14pxThe chevron’s centre, from the tab’s start, at rest.
--wm-side-panel-rail-chevron-hover-center20pxThe chevron’s centre, from the tab’s start, under a pointer.
--wm-side-panel-rail-indicator-width3pxThe selected item’s bar.
--wm-side-panel-rail-indicator-height16pxThe selected item’s bar.
--wm-side-panel-rail-indicator-colorvar(--md-sys-color-secondary)The selected item’s bar.
--wm-side-panel-rail-indicator-cornervar(--md-sys-shape-corner-full)The corners of the selected item’s bar.
--wm-side-panel-rail-move-durationvar(--md-sys-motion-spring-spatial-default-duration)How long the strip, tab and chevron take to move.
--wm-side-panel-rail-move-easingvar(--md-sys-motion-spring-spatial-default-easing)The curve of the strip, tab and chevron.
--wm-side-panel-rail-fade-durationvar(--md-sys-motion-spring-effects-default-duration)How long the items’ fade and the tab’s colour take.
--wm-side-panel-rail-fade-easingvar(--md-sys-motion-spring-effects-default-easing)The curve of the items’ fade and the tab’s colour.