Skip to Content
Kokonut UI

BG-06Backgrounds

Drape Background

A pleated curtain in a breeze that you can push and pull, built with React, WebGL and a cloth simulation.

Install with
no extra packages

PRODither Reveal Hero and more like it are in Kokonut UI Pro

Installation

Drape Background is a free, open-source React component in the Kokonut UI Backgrounds collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/drape-background.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/drape-background

Usage

import DrapeBackground from "@/components/kokonutui/drape-background";

export default function Example() {
  return <DrapeBackground />;
}

Props

className
string

Extra classes for the root element.

children
ReactNode

Content shown over the curtain. Pass null for a bare background.

wind
numberDefault 1

Strength of the breeze. 0 lets the curtain hang still.

pleat
numberDefault 34

Depth of the pleats along the top, in px.

interactive
booleanDefault true

Push the fabric with the cursor and grab it to drag it around.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.