Rendyn

Component library

189 components

Interaction

Preview Rail

Preview Rail separates the active destination, optional previews and selection callbacks.

Interactive exampleReact Tailwind CSS

Practical React example

Offer compact navigation between sections of a long document while revealing destination descriptions.

Before you copy and paste

Keep the example in the React rendering environment required by the imported component. Copy components/motion/preview-rail.tsx and its returned support files from the Code tab; preserve the project-relative paths.

Listed package dependencies: clsx, motion, react, tailwind-merge.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Offer compact navigation between sections of a long document while revealing destination descriptions

// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";

import { PreviewRail } from "@/components/motion/preview-rail";

export const previewRailItems = [
  {
    id: "dashboard",
    label: "Dashboard",
    description: "Return to your workspace overview and recent activity.",
    href: "#dashboard",
  },
  {
    id: "components",
    label: "Components",
    description: "Browse motion primitives for React and Next.js.",
    href: "#components",
  },
  {
    id: "blocks",
    label: "Blocks",
    description: "Explore composed, product-ready interface blocks.",
    href: "#blocks",
  },
  {
    id: "playground",
    label: "Playground",
    description: "Tune motion values and preview behavior live.",
    href: "#playground",
  },
  {
    id: "docs",
    label: "Documentation",
    description: "Read installation, usage, and API reference notes.",
    href: "#docs",
  },
  {
    id: "changelog",
    label: "Changelog",
    description: "Review newly launched components and improvements.",
    href: "#changelog",
  },
  {
    id: "sponsors",
    label: "Sponsors",
    description: "Support continued development of the open-source library.",
    href: "#sponsors",
  },
  {
    id: "pro",
    label: "beUI Pro",
    description: "Get premium components and lifetime access.",
    href: "#pro",
  },
  {
    id: "examples",
    label: "Examples",
    description: "See components composed in practical interface patterns.",
    href: "#examples",
  },
  {
    id: "templates",
    label: "Templates",
    description: "Start from polished layouts built with beUI components.",
    href: "#templates",
  },
  {
    id: "guides",
    label: "Guides",
    description: "Learn how to combine motion primitives effectively.",
    href: "#guides",
  },
  {
    id: "community",
    label: "Community",
    description: "Discover what other builders are creating with beUI.",
    href: "#community",
  },
  {
    id: "github",
    label: "GitHub",
    description: "View the source, report issues, and contribute improvements.",
    href: "#github",
  },
  {
    id: "about",
    label: "About",
    description: "Learn more about the ideas and people behind beUI.",
    href: "#about",
  },
];

export function PreviewRailPreview() {
  return (
    <div className="flex w-full flex-col gap-8">
      <PreviewRail
        items={previewRailItems}
        defaultActiveId="docs"
        className="mx-auto h-[360px] w-full max-w-2xl"
      />
      <PreviewRail
        items={previewRailItems}
        orientation="horizontal"
        defaultActiveId="docs"
        className="mx-auto h-[280px] w-full max-w-2xl"
      />
    </div>
  );
}

Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.

Keep IDs stable and point href values at real section anchors. If a preview contains important information, make that information available at the destination too.

Customization

PreviewRailProps.items
Required; PreviewRailItem[].
PreviewRailProps.label
Optional; string.
PreviewRailProps.orientation
Optional; "vertical" | "horizontal".
PreviewRailProps.activeId
Optional; string.
PreviewRailProps.defaultActiveId
Optional; string.
PreviewRailProps.onActiveChange
Optional; (id: string) => void.
PreviewRailProps.onItemSelect
Optional; (item: PreviewRailItem) => void.
PreviewRailProps.renderPreview
Optional; (item: PreviewRailItem) => ReactNode.
PreviewRailProps.showPreview
Optional; boolean.
PreviewRailProps.previewSide
Optional; "before" | "after".
PreviewRailProps.highlightActive
Optional; boolean.
PreviewRailProps.itemSize
Optional; number.
PreviewRailProps.children
Optional; ReactNode.
PreviewRailProps.className
Optional; string.

Integration notes

  • Do not rely on hovering the rail to discover essential navigation.
  • Verify focus-visible styling and the chosen orientation at narrow widths.

Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP