CD-07Cards
Momentum Rail
A card rail you flick with momentum, snapping on a spring, with scroll-driven cover-flow depth and parallax.
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-cardsOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/carousel-cards.tsx.
npm install lucide-reactUsage
import CarouselCards from "@/components/kokonutui/carousel-cards";
export default function Example() {
return <CarouselCards />;
}Props
itemsRailItem[]Default built-intitlestringDefault "Weekend escapes"eyebrowstringDefault "Picked for this autumn"defaultFavoritesstring[]Default []Ids saved on first render.
onToggleFavoriteToggleFavoriteCalled when a card's heart is toggled, with the item id and new state.
onSelect(item: RailItem) => voidCalled when a card without an href is clicked or activated.
classNamestringExtra classes for the root element.
RailItem
idrequiredstringtitlerequiredstringlocationrequiredstringimagestringPhoto URL, rendered with a plain <img>. Falls back to scene.
imageAltstringAlt text for image. Empty by default: the title already names it.
sceneRailSceneBuilt-in drawn artwork, used when there is no image.
badgestringdatesstringpricerequirednumbercurrencystringpriceLabelstringratingnumberreviewCountnumberhrefstringToggleFavorite
type ToggleFavorite = (id: string, favorite: boolean) => void;RailScene
type RailScene =
| "city"
| "mountains"
| "dunes"
| "lake"
| "islands"
| "skyline"
| "terraces"
| "coast";Dependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react | ^0.556.0 | npm, installed by the CLI |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

