pastetaste
Rim Carousel
Portrait cards on the rim of a big wheel whose hub sits below the stage. It turns one card at a time like a dial, with a heavy ease and a pause; drag, flick, click or arrow-key it. The caption follows the turn.
Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.
Live demo. Move the mouse and scroll inside it.
Install
Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/rim-carousel.tsx.
npx shadcn@latest add https://pastetaste.com/r/rim-carousel.jsonDependenciesmotion@^12.23.0
Prompt
Install the pastetaste component "Rim Carousel" (rim-carousel) into this Next.js project and use it.
What it is: Portrait cards on the rim of a big wheel whose hub sits below the stage. It turns one card at a time like a dial, with a heavy ease and a pause; drag, flick, click or arrow-key it. The caption follows the turn.
Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:
Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/rim-carousel.json
(it writes components/pastetaste/rim-carousel.tsx; install any npm packages it reports: motion@^12.23.0).
2. Import it: import { RimCarousel } from "@/components/pastetaste/rim-carousel" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.
Props (all optional unless the type has no default):
- items: RimItem[] = 8 typographic sheets — Cards in order: { src, alt, content, position, title, meta, description, href }. content replaces the image; title, meta and description feed the caption.
- cardWidth: string = 'clamp(150px, min(17cqw, 28svh), 252px)' — Card width as a CSS length; cqw refers to the carousel's own width. Height follows aspect.
- aspect: number = 2 / 3 — Card width over height.
- wheelRadius: number = 4.8 — Wheel radius in card widths. Larger gives a flatter arc and less lean.
- gap: number = 0.03 — Space between neighbouring cards at their middles, as a fraction of the card width; negative overlaps more.
- rounded: number = 0.1 — Corner radius as a fraction of the card width.
- autoplay: boolean = true — Turn one card at a time on its own. Pauses on hover, keyboard focus, off-screen and in hidden tabs; off under reduced motion.
- hold / duration: number / number = 1.7 / 1.45 — Seconds the wheel rests on a card, and seconds one autoplay step takes.
- direction: 'next' | 'prev' = 'next' — Which way autoplay turns; 'next' brings the card on the right to the middle.
- index / defaultIndex: number / number = — / 0 — Controlled or initial middle card. A new index turns the short way round.
- onActiveChange: (index: number) => void — Called after the middle card changes, from any input.
- onSelect: (item: RimItem, index: number) => void — Called on a click on the middle card or Enter on the focused wheel. Items with href also navigate.
- caption / controls / plate: boolean = true — Show the counter and caption, the previous / pause / next buttons, and the faint wheel plate behind the hub.
- draggable / wheel: boolean = true — Drag, swipe and flick the rim; turn it with a trackpad's horizontal swipe (vertical scrolling stays with the page).
- label: string = 'Gallery' — Accessible name of the carousel region.
Live preview: https://pastetaste.com/c/rim-carousel
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.Props 15
| Prop | Type | Default | Description |
|---|---|---|---|
| items | RimItem[] | 8 typographic sheets | Cards in order: { src, alt, content, position, title, meta, description, href }. content replaces the image; title, meta and description feed the caption. |
| cardWidth | string | 'clamp(150px, min(17cqw, 28svh), 252px)' | Card width as a CSS length; cqw refers to the carousel's own width. Height follows aspect. |
| aspect | number | 2 / 3 | Card width over height. |
| wheelRadius | number | 4.8 | Wheel radius in card widths. Larger gives a flatter arc and less lean. |
| gap | number | 0.03 | Space between neighbouring cards at their middles, as a fraction of the card width; negative overlaps more. |
| rounded | number | 0.1 | Corner radius as a fraction of the card width. |
| autoplay | boolean | true | Turn one card at a time on its own. Pauses on hover, keyboard focus, off-screen and in hidden tabs; off under reduced motion. |
| hold / duration | number / number | 1.7 / 1.45 | Seconds the wheel rests on a card, and seconds one autoplay step takes. |
| direction | 'next' | 'prev' | 'next' | Which way autoplay turns; 'next' brings the card on the right to the middle. |
| index / defaultIndex | number / number | — / 0 | Controlled or initial middle card. A new index turns the short way round. |
| onActiveChange | (index: number) => void | - | Called after the middle card changes, from any input. |
| onSelect | (item: RimItem, index: number) => void | - | Called on a click on the middle card or Enter on the focused wheel. Items with href also navigate. |
| caption / controls / plate | boolean | true | Show the counter and caption, the previous / pause / next buttons, and the faint wheel plate behind the hub. |
| draggable / wheel | boolean | true | Drag, swipe and flick the rim; turn it with a trackpad's horizontal swipe (vertical scrolling stays with the page). |
| label | string | 'Gallery' | Accessible name of the carousel region. |