Installation
Install the library, with React only when you use the optional adapter.
npm install flag-cloth
# or
pnpm add flag-clothThere are no required runtime packages. For React, your application supplies React 18 or newer:
npm install flag-cloth react react-dom
# or
pnpm add flag-cloth react react-domEntry points
import { createFlagCloth } from 'flag-cloth';
import { FlagCloth } from 'flag-cloth/react';The vanilla entry point does not import React. The React component is a small lifecycle adapter around the same core instance.
Browser requirements
The default renderer requires WebGL2 and Pointer Events. The simulation itself does not require WebGL and can be unit-tested in Node.