Skip to Content
Kokonut UI

CD-07Cards

Momentum Rail

A card rail you flick with momentum, snapping on a spring, with scroll-driven cover-flow depth and parallax.

Install with
lucide-react

PROOnboarding Checklist and more like it are in Kokonut UI Pro

Installation

Momentum Rail is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/carousel-cards.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/carousel-cards

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/carousel-cards.tsx.

npm install lucide-react

Usage

import CarouselCards from "@/components/kokonutui/carousel-cards";

export default function Example() {
  return <CarouselCards />;
}

Props

items
RailItem[]Default built-in
title
stringDefault "Weekend escapes"
eyebrow
stringDefault "Picked for this autumn"
defaultFavorites
string[]Default []

Ids saved on first render.

onToggleFavorite
ToggleFavorite

Called when a card's heart is toggled, with the item id and new state.

onSelect
(item: RailItem) => void

Called when a card without an href is clicked or activated.

className
string

Extra classes for the root element.

RailItem

idrequired
string
titlerequired
string
locationrequired
string
image
string

Photo URL, rendered with a plain <img>. Falls back to scene.

imageAlt
string

Alt text for image. Empty by default: the title already names it.

scene
RailScene

Built-in drawn artwork, used when there is no image.

badge
string
dates
string
pricerequired
number
currency
string
priceLabel
string
rating
number
reviewCount
number
href
string

ToggleFavorite

type ToggleFavorite = (id: string, favorite: boolean) => void;

RailScene

type RailScene =
  | "city"
  | "mountains"
  | "dunes"
  | "lake"
  | "islands"
  | "skyline"
  | "terraces"
  | "coast";

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.