Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Preview Rail

Preview

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/preview-rail

Import the shared styles once in your application.

TSUsage
import PreviewRail from '@/components/beui/layout/PreviewRail.vue'
import '@/components/beui/styles.css'

API Reference

items
readonly PreviewRailItem[]
Default—
label?
string

Accessible name of the navigation landmark.

Default—
orientation?
"vertical" | "horizontal"
Defaultvertical
activeId?
string

Controlled active tick. `v-model` (`modelValue`) is the alias.

Default—
defaultActiveId?
string
Default—
@active-change?
(id: string) => void
Default—
@item-select?
(item: PreviewRailItem) => void
Default—
#renderPreview?
{ item: PreviewRailItem }

Alias of `preview`, named after the React `renderPreview` prop.

Default—
showPreview?
boolean
Defaulttrue
previewSide?
"before" | "after"
Defaultafter
highlightActive?
boolean
Defaultfalse
itemSize?
number

Height (or width, when horizontal) of one tick row in px.

Default24
className?
string
Default—
railClassName?
string
Default—
previewContainerClassName?
string
Default—
previewClassName?
string
Default—
labels?
Partial<PreviewRailMessages>

Override any built-in string.

Default—
v-model?
string

Stable identity of the chosen tick; `activeId` is the prop alias.

Default—
@select?
(item: PreviewRailItem) => void

Alias of `itemSelect`.

Default—
#default?
slot

Content beside the rail.

Default—
#preview?
{ item: PreviewRailItem }

Card shown for the highlighted tick.

Default—

Updated