0Views
0Copies

API Reference
Props for <PostcardRack />
| Prop | Type | Default | Description |
|---|---|---|---|
| wallColor | string | "#466a67" | The painted board wall behind the rack. |
| floorColor | string | "#dcc8a3" | The sandy paving it stands on. |
| mapColor | string | "#c9ece4" | The world map painted on the wall. |
| wireColor | string | "#f4f5f1" | The enamelled wire of the rack and its pole. |
| footColor | string | "#b92a16" | The cast-iron foot. |
| signColor | string | "#c62f19" | The enamel sign on top. |
| signTextColor | string | "#fff3dc" | The words, chevron and inner border of the sign. |
| arrowColor | string | "#fffdf7" | The round buttons either side of the rack. |
| arrowIconColor | string | "#14284a" | The chevrons in the arrow buttons. |
| lighting | 'day' | 'night' | "day" | Daylight, or moonlight with a warm street light above; it drifts from one to the other. |
| Prop | Type | Default | Description |
|---|---|---|---|
| signText | string | "Pick a season" | What the sign says, with a chevron after it; empty hides the sign. |
| greeting | string | "Greetings from" | The handwritten line above the name on a Greetings card. |
| font | FontValue | {"fontFamily":"Gabarito","fontWeight":800} | The names on the cards and the sign. The component doesn’t load the font: add it to your app. |
| handFont | FontValue | {"fontFamily":"Nanum Pen Script"} | The handwritten greeting. The component doesn’t load the font: add it to your app. |
| Prop | Type | Default | Description |
|---|---|---|---|
| mapOpacity | number | 0.28 | How strong the map on the wall is; 0 hides it. |
| rackSize | number | 0.81 | How tall the rack stands, as a share of the height of its container. |
| detent | number | 58 | How hard it pulls into place at each side: higher is a snappier click. |
| friction | number | 1.5 | How quickly a flick dies away: lower spins longer. |
| topSpeed | number | 7 | The fastest a flick can turn it. |
| rattle | number | 1 | How much the cards swing and the rack rocks; 0 is stiff. |
| expandOnClick | boolean | true | A clicked card comes out of the rack and up to the eye; off, a click only calls onCardClick. |
| cardSize | number | 0.74 | How tall an open card stands, as a share of the height of the rack. |
| liftDuration | number | 0.95 | How long a card takes to come out of its pocket and up to the eye. |
| Prop | Type | Default | Description |
|---|---|---|---|
| cards | Array<{ image, title, subtitle, print }> | [{"title":"Alps","subtitle":"Switzerland","image":"/motionuikit/images/postcard-alps.webp","print":"border"},{"title":"Porto","subtitle":"Portugal","image":"/motionuikit/images/postcard-porto.webp","print":"greeting"},{"title":"New York","subtitle":"United States","image":"/motionuikit/images/postcard-newyork.webp","print":"greeting"},{"title":"Kyoto","subtitle":"Japan","image":"/motionuikit/images/postcard-kyoto.webp","print":"full"},{"title":"Banff","subtitle":"Canada","image":"/motionuikit/images/postcard-banff.webp","print":"full"},{"title":"Yukon","subtitle":"Canada","image":"/motionuikit/images/postcard-yukon.webp","print":"border"},{"title":"London","subtitle":"United Kingdom","image":"/motionuikit/images/postcard-london.webp","print":"border"},{"title":"Cape Town","subtitle":"South Africa","image":"/motionuikit/images/postcard-capetown.webp","print":"greeting"},{"title":"Petra","subtitle":"Jordan","image":"/motionuikit/images/postcard-petra.webp","print":"border"},{"title":"Paris","subtitle":"France","image":"/motionuikit/images/postcard-paris.webp","print":"border"},{"title":"Santorini","subtitle":"Greece","image":"/motionuikit/images/postcard-santorini.webp","print":"greeting"},{"title":"Fuji","subtitle":"Japan","image":"/motionuikit/images/postcard-fuji.webp","print":"border"},{"title":"Utah","subtitle":"United States","image":"/motionuikit/images/postcard-utah.webp","print":"greeting"},{"title":"Venice","subtitle":"Italy","image":"/motionuikit/images/postcard-venice.webp","print":"border"},{"title":"Marrakech","subtitle":"Morocco","image":"/motionuikit/images/postcard-marrakech.webp","print":"full"},{"title":"Agra","subtitle":"India","image":"/motionuikit/images/postcard-agra.webp","print":"full"},{"title":"Rome","subtitle":"Italy","image":"/motionuikit/images/postcard-rome.webp","print":"border"},{"title":"Bali","subtitle":"Indonesia","image":"/motionuikit/images/postcard-bali.webp","print":"greeting"},{"title":"Dubai","subtitle":"UAE","image":"/motionuikit/images/postcard-dubai.webp","print":"greeting"},{"title":"Manarola","subtitle":"Italy","image":"/motionuikit/images/postcard-manarola.webp","print":"border"},{"title":"Tokyo","subtitle":"Japan","image":"/motionuikit/images/postcard-tokyo.webp","print":"full"},{"title":"Caribbean","subtitle":"Saint Lucia","image":"/motionuikit/images/postcard-caribbean.webp","print":"greeting"},{"title":"Andes","subtitle":"Peru","image":"/motionuikit/images/postcard-andes.webp","print":"full"},{"title":"Lisbon","subtitle":"Portugal","image":"/motionuikit/images/postcard-lisbon.webp","print":"full"}] | The cards, eight sides by three rows from the top; fewer repeat to fill the 24 pockets. |
| showArrows | boolean | true | The round buttons that turn the rack a side at a time. |
| Prop | Type | Default | Description |
|---|---|---|---|
| onCardClick | (index: number, card: PostcardRackCard) => void | — | A card was clicked: its pocket, 0–23 row by row from the top, and the card shown there. |
| onCardClose | () => void | — | The open card was put back. |
| onSignClick | () => void | — | The sign was clicked. |
| onFrontChange | (side: number) => void | — | A new side has come round to the front, 0–7. |
Motion score
Compositor-only
- Category
- 3D Elements
- Framework
- React
- Published
- Dec 4, 2026
- Dependencies
- Variants
Postcard Rack: a 3D postcard rack for React
A wire rack of travel postcards stands on a paved floor in front of a world map wall. Flick it and it spins, then clicks into place while the cards swing. Click a card and it slides out and flies up to you.
Use Postcard Rack to show places, destinations or a collection as cards people want to pick up and browse. It's a Pro React component for Next.js, Vite and Astro with Tailwind CSS v4. More in this category.
What is Postcard Rack?#
Postcard Rack is a 3D postcard rack you spin by hand, like the wire stands outside a souvenir shop. It holds 24 cards in pockets, eight sides by three rows, and you can open any card to read it up close. It's built with React Three Fiber and three.js, so every card is a real 3D postcard with depth, light and shadow.
How Postcard Rack works#
Drag or flick the rack and it turns, slows down and clicks into place with one side facing you. The cards swing and the rack rocks a little as it stops. detent (58) sets how hard it pulls into place, friction (1.5) how quickly a flick fades, topSpeed (7 rad/s) the fastest it can turn, and rattle (1) how much the cards move. The round arrow buttons turn it one side at a time.
Click a card and it swings round, slides out of its pocket and flies up close. Click again or press Escape to put it back. Turn expandOnClick off and a click only calls onCardClick, so you can open your own page or modal instead. The sign on top reads "Pick a season" by default and has its own onSignClick.
Customization options#
Change the cards, sign text, colors, fonts, lighting and spin in the Customize panel, save a look as a variant, then install. Each card has a photo, a name, a line underneath and one of three print styles: lettering on the photo, a paper band, or a Greetings card. If you add fewer than 24 cards, they repeat to fill the pockets. The fonts aren't bundled, so load Gabarito and Nanum Pen Script, or your own, in your app. The rack fills its parent, so give the parent a height.
Use cases#
- Travel and tourism sites that let visitors pick a destination from a postcard spinner rack.
- Evening or nightlife pages, with the Night variant: the shop after dark under a warm street light.
- Coastal and holiday brands, with Harbour: a sea-blue wall and an amber sign that asks "Where next?".
- Playful portfolios and collections, with Loose: a terracotta wall and a slippery spinning rack whose cards rattle harder.
FAQs#
Yes. Each card takes a photo, cropped to fit. A photo from another domain must allow CORS, or WebGL can't draw it.
When a visitor has reduced motion turned on, the cards stop swinging, and the rack, sign and cards jump to their new place instead of easing there.
No. Postcard Rack is a Pro component, included in every paid plan. Anything you install stays yours after your plan ends.
It's a React component for Next.js, Vite and Astro with Tailwind CSS v4. In a JavaScript project, the CLI converts
it to a .jsx file.