# Rail shell

A top bar with context pickers, an icon rail and an optional page column.

Import from `@a31labs/rax/rail-shell`.

## Usage

```tsx
<RailShell
  brand={<Logo />}
  context={<><VenuePicker /> / <AppPicker /></>}
  actions={<Avatar name="Ada Lovelace" />}
  rail={[
    { label: "Home", href: "/", icon: <House /> },
    { label: "Bookings", href: "/bookings", icon: <CalendarCheck />, current: true },
  ]}
  railEnd={[{ label: "Settings", href: "/settings", icon: <Settings /> }]}
  subnav={{ title: "Bookings", items: [{ label: "Today", href: "/bookings", current: true }, { label: "Waitlist", href: "/bookings/waitlist" }] }}
  renderLink={(p) => <NextLink {...p} />}
>
  {children}
</RailShell>
```

## Rules

Props: `brand`, `context` (beside the brand, e.g. company and site pickers), `actions` (right side of the bar), `rail` (`{ label, href, icon, current, attrs }`), `railEnd` (pinned to the bottom of the rail), `subnav` (`{ title, items: { label, href, current } }`, a second column with the section's pages), children, `renderLink`. A 56px top bar across the page; below it an 88px rail of icons (20px) with their label under them at 14px, the current section on accent-soft with its icon in the accent. The subnav column is 220px with plain links, the current one on surface-2. Below 1024px the subnav becomes a scrolling row above the content; below 640px the rail becomes a tab bar fixed to the bottom. Set `--rax-shell-top` when something sticky sits above the shell.

Page: https://rax.a31.at/components/rail-shell
