blackchalkv0.3.0
Components

Shape

SketchShape — a hand-drawn geometric shape rendered with rough.js.

SketchShape renders a rough.js circle, triangle, or rectangle at a given size. All drawing options (fill, stroke, roughness) are configurable via props.

Shapes

import { SketchShape } from "blackchalk";<div style={{ display: "flex", gap: 24, alignItems: "flex-end" }}><SketchShape shape="circle" size={48} /><SketchShape shape="triangle" size={48} /><SketchShape shape="rectangle" size={48} /></div>

Props

PropTypeDefault
shape"circle" | "triangle" | "rectangle"
sizenumber36
fillstringfills.light
roughnessnumber1.5
strokestringcolors.fg
strokeWidthnumberstrokes.surface

See it in the Storybook playground, or read the source.

On this page