Skip to content

    Browse components

    Stretch Rail

    Sidebar navigation whose glowing line indicator stretches toward the new item and springs back to size.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/stretch-rail

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/stretch-rail.json

    Usage

    import { StretchRail } from "@/components/ui/stretch-rail";
    
    <StretchRail
      items={[
        { label: "Dashboard", icon: <LayoutGrid /> },
        { label: "Inbox", icon: <Inbox />, badge: "12" },
      ]}
    />

    Props

    PropTypeDefaultDescription
    itemsReactNode—Array of { label, icon?, badge? }.
    defaultActivenumber0Index selected at first render.
    colorstring"#c6f24e"Indicator color.
    stiffnessnumber420Spring stiffness of the leading edge.
    showTrackbooleantrueShow the faint rail behind the indicator.
    onSelectReactNode—Called with the selected index.
    classNamestring—Extra classes for the root element.