Getting started
Getting started
Install the package, then draw the dots on a canvas, or drop in the React component.
Install
npm install @reuse-sh/loadersUse it
The browser module works without a framework. In React, the component creates the same controller when it mounts and destroys it when it unmounts.
import {
createThinkingDots,
figureConfig,
} from "@reuse-sh/loaders";
const loader = createThinkingDots(canvas, {
size: 32,
config: figureConfig("triangle-turn"),
});
// Later, when the answer arrives
loader.destroy();import { ThinkingDots } from "@reuse-sh/loaders/react";
import "@reuse-sh/loaders/styles.css";
<ThinkingDots size={24} label="Preparing your answer" />