# Cloth Simulation

> Tearable cloth simulation with real Verlet integration physics. A fabric grid hangs from pinned points with gravity and wind — grab it with your mouse, drag it around, throw it with momentum. Pull hard enough and the constraints snap, ripping the cloth apart. Fabric changes color under stress — blue when relaxed, red when stretched near tearing point. Triangle-mesh rendering with per-face normal shading. Configurable grid size, gravity, wind, damping, stiffness, tear threshold, and colors. Zero external dependencies.

- Author: [Yad Hakim](https://21st.dev/@dev.yadhakim)
- License: unknown
- Live preview: https://21st.dev/@dev.yadhakim/components/cloth-simulation

## Install

```bash
npx shadcn@latest add "https://21st.dev/r/dev.yadhakim/cloth-simulation?api_key=$API_KEY_21ST"
```

Requires a 21st API key (generate one at https://21st.dev/mcp) passed as `API_KEY_21ST`. Free accounts get a limited number of installs per day; unlimited on a paid plan — see https://21st.dev/pricing.

Full component directory: https://21st.dev/llms.txt
