Skip to content

Preview Rail

Pro

A column of ticks for the sections of a page. The ticks near the pointer grow, and a card glides to the item and names it.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Preview Rail needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
26
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Put one item for each slide or section in the rail. The title and the description in an item fill its preview card.

slide-rail.tsx

PreviewRail

<div>
PropTypeDefaultDescription
classNamestring—
valuestring | null—The value of the active item (controlled). null: no item is active.
defaultValuestring | nullnullThe active item at the start (uncontrolled).
onValueChange—Called with the item value on a click, a key press, or the end of a scrub, and the Base UI change details of that click.
orientation"horizontal""vertical""vertical"The axis of the rail (default vertical).
side"end""start""end"Where the card shows (default end): end is the inline end of a vertical rail (the right in left to right) or under a horizontal one; start is the other side.
size"default""lg""sm""default"The pitch and tick size: sm 12px, default 16px, lg 20px per item.
magnificationnumber2The largest tick scale under the pointer (default 2). 1 turns the growth off.
distancenumber3How far the growth reaches, in ticks (default 3).
cardClassNamestring—Classes of the card (its width, for example).
From Base UIToolbar.RootBase UI docs
disabledboolean—
loopFocusbooleantrueIf true, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

PreviewRailItem

<button>
PropTypeDefaultDescription
childrenReactNode—The card content (PreviewRailTitle, PreviewRailDescription, or your own).
classNamestring—
valueRequiredstring—The item value: unique in the rail.
labelRequiredstring—The name of the item for screen readers, and the card title when there are no children.
From Base UIToolbar.ButtonBase UI docs
disabledbooleanfalseWhen true the item is disabled.
focusableWhenDisabledbooleantrueWhen true the item remains focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

PreviewRailLink

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

PreviewRailTitle

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

PreviewRailDescription

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.

PreviewRailSeparator

<div>
PropTypeDefaultDescription
classNamestring—
From Base UIToolbar.SeparatorBase UI docs
orientation"horizontal""vertical"—The orientation of the separator. Defaults to the opposite of the toolbar's orientation, so a horizontal toolbar renders vertical separators.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Give the root an aria-label, and a label to each item: a tick has no text.
  • Set value from the scroll to follow the page.
  • Use orientation="horizontal" for a row of slides or steps.
  • For a list of headings people read, use a Track Contents.
  • For a few views with text labels, use Tabs.
TabMoves the focus to the current item. The card shows for it.
Arrow keysMove the focus along the rail.
Home / EndMove the focus to the first or the last item.
Enter / SpaceOpens the focused item.
Ticks
indicator · the ticks near the pointer grow, and the marker moves to the current item
Card
glide · the card moves to the item under the pointer, and its content rolls
Card show
popup · the card fades in, and fades out on leave

Built with

Installs with Preview Rail

Components
Direction
  1. AddedPreview Rail, with Direction.
Open the release