0Views
0Copies

API Reference
Props for <ClothCurtain />
| Prop | Type | Default | Description |
|---|---|---|---|
| clothColor | string | "#3550f0" | The wool where the lamp lights it, at the top left. |
| clothShadeColor | string | "#1a2aa6" | The wool away from the lamp. |
| textColor | string | "#efe6d4" | The big printed words and the aside. |
| badgeColor | string | "#1c1b19" | The round sticker. |
| badgeTextColor | string | "#fbf8f1" | The sticker's lines. |
| brassColor | string | "#d6b37a" | The rings, the rod's lit edge and the sticker's rim. |
| rodColor | string | "#151515" | The rod the rings hang on. |
| sheenColor | string | "#fff4e0" | The shine on the folds' ridges. |
| revealColor | string | "#0c1238" | The stage's backdrop. |
| revealTextColor | string | "#efe6d4" | The line on the stage. |
| revealAccentColor | string | "#f1d9a8" | The spotlights. |
| revealConfettiColor | string | "#3550f0" | The confetti's main colour; the spotlights' and the line's colours join it. |
| Prop | Type | Default | Description |
|---|---|---|---|
| headline | string | "Don't\npull." | The big printed words, one line per line break. |
| aside | string | "(grab it, drag it open →)" | The small line beside the last word; empty hides it. |
| badge | string | "Opening\nspring\n2027" | The sticker's lines, one per line break; empty hides the sticker. |
| font | FontValue | {"fontFamily":"Bricolage Grotesque","fontWeight":800} | The face of the big words; the component doesn't load the font, so add it to your app. |
| labelFont | FontValue | {"fontFamily":"Geist Mono","fontWeight":400} | The face of the aside and the sticker; add it to your app too. |
| revealText | string | "A welcome gift for our first 100 visitors, on us." | The line in the middle of the stage; empty hides it. |
| Prop | Type | Default | Description |
|---|---|---|---|
| trigger | 'drag' | 'scroll' | 'manual' | "drag" | Drawn aside by dragging it sideways with the mouse or a finger, as the page scrolls, or by the progress value you pass in. |
| scrollDistance | number | 80 | How far you scroll to draw it fully aside, as a share of the window's height; past the page's end, the wheel or a swipe keeps drawing it. |
| progress | number | 0 | How far it is drawn aside: 0 closed, 1 gone. |
| drawTime | number | 2.8 | The fastest a full draw may take, however fast the scroll; higher feels heavier. |
| wind | number | 0.6 | The breeze that keeps it moving at rest; 0 holds it still. |
| pleats | number | 1 | Depth of the pleats as the rings bunch: 0 flat, 1 natural, 1.5 deep. |
| swing | number | 1 | How far the hem swings behind the rod as it is drawn. |
| gather | number | 9 | How narrow it bunches before sliding off the right edge, as a share of the width. |
| bounce | number | 1 | The bob on the rod and kick of the hem when it is first seen; 0 for none. |
| shadow | number | 0.3 | Darkness of the shadow it casts on what's behind it. |
| Prop | Type | Default | Description |
|---|---|---|---|
| reveal | boolean | true | Shows a lit stage behind the cloth: its spotlights sweep once it opens, with a line in the middle and a burst of confetti. Off, what's beneath the curtain shows through. |
| revealConfetti | boolean | true | A burst of confetti each time it opens. |
| grab | boolean | true | A mouse or pen can hold and drag the cloth; on touch, a sideways drag. |
| Prop | Type | Default | Description |
|---|---|---|---|
| grabSize | number | 0.08 | The size of the held patch, as a share of the height. |
| grabLift | number | 0.1 | How far a held patch lifts toward you, as a share of the height. |
| springBack | number | 10 | How firmly it springs back into its pleats after a drag; lower floats. |
| heaviness | number | 3 | Its weight, felt while held and as it falls back; higher drops harder. |
| stiffness | number | 7 | Constraint passes per step: more makes crisper, less stretchy cloth. |
Motion score
Compositor-only
- Category
- Scroll Effects
- Framework
- React
- Published
- Dec 4, 2026
- Dependencies
- Variants
Cloth Curtain: a curtain animation for React
A printed wool curtain hangs on brass rings over a dark stage. It bobs on its rod when it comes into view and sways in a light breeze. Drag it open and it bunches into pleats, then slides away to show spotlights and confetti.
Use Cloth Curtain as a curtain animation that hides a launch, an event or an offer behind something people want to pull. Set the printed words, the sticker, every color, the fonts and how heavy the cloth feels. It's a Pro React component for Next.js, Vite and Astro with Tailwind CSS v4. More in this category.
What is Cloth Curtain?#
Cloth Curtain is a curtain animation for React that moves like real fabric, not a sliding panel. Under the print is a cloth simulation: a grid of points hung from rings on a rod, drawn in WebGL with shaders for the folds, sheen and shadow. It's a single React file, and its only dependency is the cn helper.
How Cloth Curtain works#
When the curtain first comes into view, it bobs on its rod and the hem kicks out. At rest, wind (0.6) keeps it moving in a light breeze. With the default drag trigger, you pull it sideways with a mouse or a finger. Set trigger to scroll to draw it open as the page moves, or to manual and pass progress from 0 to 1. drawTime (2.8 s) is the fastest a full draw can take, so it always feels heavy.
As it opens, the rings bunch together, the cloth folds into pleats and slides off the right edge. With grab on, a mouse or pen can hold a patch of cloth and lift it toward you. Let go and it springs back.
Behind it, reveal shows a lit stage. Once the curtain is open, the spotlights sweep, your revealText line appears and confetti bursts: that's the curtain reveal. Turn reveal off and your own page shows through instead.
Customization options#
Change the cloth, print, sticker, brass, rod and stage colors, the headline, aside, sticker lines and fonts in the Customize panel, save a look as a variant, then install. Tune how it feels with pleats, swing, bounce, gather and heaviness. In the source, pass children to hang the curtain over your own content. It fills its parent, so put it inside a sized, relative element. The fonts aren't bundled, so load Bricolage Grotesque and Geist Mono, or your own, in your app.
Use cases#
- Product launches, with Product Drop: matte black cloth, white block type and an orange drop sticker on steel rings.
- Events, premieres and shows, with Opening Night: a heavy red velvet curtain in gold serif, for a slow curtain opening animation.
- Seasonal sales, with Summer Sale: a light linen blind in tomato serif that blows in the breeze and hides your sale line.
- Story pages, with
triggerset toscroll, so the curtain draws aside as visitors move down the page.
FAQs#
It's a stage-style reveal where a curtain draws back to show what's behind it, like a launch or an offer. Cloth Curtain does it with real cloth physics, so the fabric folds, sways and bunches as it opens.
Yes. Pass children and the curtain hangs over them in place of the built-in stage. Or turn reveal off to show
whatever is already beneath it.
Yes. On touch, a sideways drag draws it open. It renders in WebGL, so test it on a mid-range phone. Without WebGL, it shows the print flat and slides it aside.
No. Cloth Curtain 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.