doodle-ui

Button

A clickable control. The label is real HTML. The border and fill are a rough.js rectangle sitting behind it.

<Button variant="primary" size="md" roughness={1.5}>
  Draw me
</Button>

Usage

import { Button } from "doodleui-react";

<Button variant="primary" size="md">
  Draw me
</Button>

Primary and secondary use hachure fills. Outline is stroke-only. Ghost hides the stroke until hover.

Props

PropTypeDefaultNotes
variant"primary" | "secondary" | "outline" | "ghost""primary"Fill treatment. Ghost hides the stroke until hover.
size"sm" | "md" | "lg""md"Padding and type size.
disabledbooleanfalseNative disabled state. Lowers opacity.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.