AppRail

Composable rail structure for server switching, destinations, unread attention, and footer actions.

Preview#

<AppShellRailSlot>
  <AppRailRoot>
    <AppRailHeader>
      {/* App-owned server switcher */}
    </AppRailHeader>
    <TooltipProvider>
      <AppRailNav>
        <Tooltip>
          <TooltipTrigger
            render={
              <AppRailItem
                selected
                nativeButton={false}
                render={<Link to="/chat" />}
              />
            }
          >
            <AppRailItemIcon>
              <MessageSquare />
              <AppRailItemAttention title="Unread activity">
                <Activity />
              </AppRailItemAttention>
            </AppRailItemIcon>
            <AppRailItemLabel>Chat</AppRailItemLabel>
            <AppRailItemBadge>3</AppRailItemBadge>
          </TooltipTrigger>
          <TooltipContent side="right">Chat</TooltipContent>
        </Tooltip>
      </AppRailNav>
      <AppRailFooter>
        <NotificationCenter>
          <NotificationCenterTrigger type="button" aria-label="Notification center" />
        </NotificationCenter>
        <Tooltip>
          <TooltipTrigger
            render={
              <AppRailItem
                nativeButton={false}
                render={<button type="button" />}
              />
            }
          >
            <AppRailItemIcon>
              <Settings />
            </AppRailItemIcon>
            <AppRailItemLabel>Settings</AppRailItemLabel>
          </TooltipTrigger>
          <TooltipContent side="right">Settings</TooltipContent>
        </Tooltip>
      </AppRailFooter>
    </TooltipProvider>
  </AppRailRoot>
</AppShellRailSlot>

API#WIP

PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Layout root for header, nav, and footer regions. Owns no selection state.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Top region for an app-owned server switcher or equivalent identity control.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"nav">Primary destinations region. Mount separate desktop and mobile Nav compositions when needed; visibility stays caller-owned.
PropTypeDefaultDescription
selectedbooleanMarks the item as selected. Sets data-selected and aria-pressed when nativeButton is true. Owned by the caller.
nativeButtonbooleantrueWhen false, skip native button type/disabled/aria-pressed wiring so render can replace the host element (for example a router Link).
...propsuseRender.ComponentProps<"button">Button attributes plus render. Compose icon, label, badge, and attention parts as children.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Square icon slot. Place the glyph and optional attention overlay here.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Visible or assistive label for the item.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Optional unread or count badge beside the icon.
PropTypeDefaultDescription
childrenReactNodeAttention glyph rendered inside the mask.
titlestringOptional label exposed to assistive tech. The indicator itself stays decorative.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Mask wrapper used by AppRailItemAttention around the attention glyph.
PropTypeDefaultDescription
...propsStatus propsDecorative attention status dot. Defaults to attention and a theme-aware variant; usually rendered by AppRailItemAttention.