Rail Shell
A sidebar app frame. The sidebar narrows to an icon rail with tooltips, one highlight glides between the links, and on a narrow frame the sidebar opens as a drawer.
pixikit.com/docs/app-ui/shells/rail-shell
Customize
Search
Contained
Height640px
Default collapsed
Header
Tone
Content width
Breakpoint720px
Props
23| Name | Type | Default | Description |
|---|---|---|---|
nav | RailNavItem[] | Required | The main links, in order. |
groups | RailGroup[] | [] | Secondary labelled lists under the main links, such as teams. |
current | string | None | The id of the current page, when you hold the state. |
defaultCurrent | string | None | The id of the current page at first, when the shell holds the state. |
onNavigate | (id: string) => void | None | Called with the id of the item the user picks. |
brand | ReactNode | None | The logo or name at the top of the sidebar. Put the mark first: it is what stays when the sidebar narrows. |
user | RailUser | None | The signed-in person. |
userMenu | MenuEntry[] | None | The rows of the menu the user block opens. |
search | boolean | false | Shows a search button with its shortcut hint. |
onSearch | () => void | None | Called when the search button is pressed or Cmd or Ctrl plus K is used inside the shell. |
actions | ReactNode | None | Extra controls next to the search, such as a notifications button. |
children | ReactNode | None | The page. |
contained | boolean | false | Keeps the mobile drawer, menus and tooltips inside the shell instead of on the page. |
height | number | string | 640 | The height of the shell: px or any CSS length. It fills this, never the window. |
collapsed | boolean | None | Whether the sidebar is narrowed to an icon rail, when you hold the state. |
defaultCollapsed | boolean | false | Whether the sidebar starts narrowed, when the shell holds the state. |
onCollapsedChange | (collapsed: boolean) => void | None | Called with the next collapsed state. |
persistKey | string | None | Remembers the collapsed state in local storage under this key. |
header | boolean | false | Adds a top bar for the search, the actions and the user menu; without it the user sits at the bottom of the sidebar. |
tone | "plain" | "muted" | "inverted" | "plain" | The sidebar surface: the page colour, muted, or inverted. |
contentWidth | "full" | "contained" | "full" | Centres the page in a maximum width. |
breakpoint | number | 720 | Below this width in px the sidebar leaves the layout and opens as a drawer. |
className | string | None |