Clothing Rail Gallery
Product gallery on a clothing rail: brush the hangers, slide pieces along and lift one to turn it front and back.
Source on hold: license review
The full source isn't available to copy or install yet. We're confirming the original author's license before it can be redistributed. The preview, usage example and API below are for evaluation.
Origin: User-supplied snippet (no license or author attribution included).
usage example
import ClothingRailHero, { type RailGarment } from "@/components/ui/clothing-rail-gallery";
const items: RailGarment[] = [
{ id: "oat-tee", name: "Heavyweight tee · Oat", kind: "tee", color: "#ECE6D8", tag: "₹1,499",
description: "Thick organic cotton jersey.", details: ["240 gsm", "Regular fit"] },
{ id: "camel-coat", name: "Wool overcoat · Camel", kind: "coat", color: "#C19A6B", tag: "₹7,999" },
// Or use photos: image (front), backImage, sideImage — same 200 × 310 canvas for all three.
];
export default function Shop() {
return (
<ClothingRailHero
items={items}
hanger="wood"
eyebrow="New season"
heading="A clothing rail you can handle."
caption="Lift a piece to see the back."
autoplay
onOpenChange={(i) => console.log("open", i)}
/>
);
}Documentation
Source on hold: license review
The full source isn't available to copy or install yet. We're confirming the original author's license before it can be redistributed. The preview, usage example and API below are for evaluation.
Origin: User-supplied snippet (no license or author attribution included).
Interactions
- Desktop: move the pointer along the rail to brush the pieces; drag a hanger sideways to slide it; click to lift a piece and flip it front and back.
- Phones and narrow screens: switches to a swipeable carousel with dots, sized to fit 375 px screens.
- Keyboard: Tab into the rail, ← → / Home / End to move along it, Enter or Space to lift a piece, Esc to put it back.
- Reduced motion: autoplay is off and pieces settle without swinging when the visitor prefers reduced motion.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | RailGarment[] | — | Pieces on the rail (required). |
| eyebrow | string | — | Small label above the heading. |
| heading | string | — | Section heading. |
| caption | string | — | Hint shown under the rail while nothing is selected. |
| action | ReactNode | — | Call to action rendered under the caption. |
| autoplay | boolean | false | Presents items one by one until the visitor interacts. Off when the visitor prefers reduced motion. |
| interval | number | — | Milliseconds each piece faces the front during autoplay. |
| hanger | "wood" | "matte" | "none" | "wood" | Drawn hanger. Use "none" when your photos already include a hanger. |
| labels | { front; back; close; show } | English | Button and dot labels, for translation. |
| onOpenChange | (index: number | null) => void | — | Called when a piece is lifted off the rail or put back. |
| ...props | ComponentProps<"section"> | — | Passed to the outer <section>. |
RailGarment
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | — | Unique key. |
| name | string | — | Accessible name, caption and detail title. |
| description | string | — | Text in the detail view. |
| kind | "tee" | "knit" | "hoodie" | "shirt" | "jacket" | "coat" | — | Built-in illustration used when no image is given. |
| color / trim | CSS colour | — | Fabric and trim colour of the illustration. |
| image / backImage / sideImage | string | — | Front, back and side photos. Transparent cut-outs on a 200 × 310 portrait canvas work best. |
| tag | string | — | Hang-tag text such as a price or size. |
| details | string[] | — | Short facts listed in the detail view. |
Requirements
- Needs only react and react-dom. No motion or lucide-react.
- Uses shadcn/ui colour tokens (background, foreground, card, muted, muted-foreground, border, ring). Any shadcn project already has them.