Modus UI

Draft Form

Web (React)

A turning wireframe solid inked on a drafting guide, in your theme's colours.

A canvas wireframe that turns in 3D over a dashed crosshair and registration circle, like a figure on a drafting sheet. Edges are drawn in the foreground ink with depth fading and the vertices are dotted in the primary colour, so it follows light and dark mode and the palette picker. Choose a nested icosahedron, a stellated cube or two interlocking cylinders. It pauses when off screen and draws a still frame when the user prefers reduced motion.

Modus / Draft Form

Installation

CLI

npx @modus-ui/cli add draft-form

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/draft-form.tsx.
  3. Paste the code.

Usage

tsx
import { DraftForm } from "@/components/ui/draft-form";

export default function Example() {
  return (
    <div className="flex min-h-[400px] items-center justify-center bg-background">
      <DraftForm variant="cube" />
    </div>
  );
}

Props

PropTypeDefaultDescription
variant"cube" | "cylinders" | "sphere""sphere"Which form to draw.
speednumber1Rotation speed multiplier (0 to 3).
sizenumber1Line width multiplier.
lengthnumber1Scale of the form itself (0.35 to 2.5).
opacitynumber1Opacity of the canvas.
huenumber0Hue rotation in degrees.
saturationnumber1Saturation multiplier.
brightnessnumber1Brightness multiplier.
colorstringnoneAny CSS colour for edges and vertices; defaults to the theme's ink.
classNamestringnoneExtra classes for the wrapper.

Comments

  • No comments yet.