byDefaultHuman
Getting started

Introduction

What bydefaulthuman is and when to use it.

bydefaulthuman is a hand-drawn component library for React. Each component renders a wobbly, sketched border using Rough.js — a small SVG library that makes shapes look like they were drawn by hand.

Three themes

Every component ships with three visual personalities out of the box.

ThemeRoughnessFeel
pencil0.8 – 1.2Light, sketchy, hachure fill
ink0.4 – 0.8Clean, confident, solid fill
crayon2.0 – 2.8Wild, thick, zigzag fill

How it works

Every component is two layers working together.

A real HTML element — a <button>, <div>, <input>, etc. This handles all browser behaviour: focus, keyboard events, form submission, and accessibility. Nothing unusual here.

A Rough.js SVG overlay — an absolutely-positioned <svg> with pointer-events: none drawn on top. It never intercepts clicks or focus. It is purely visual.

Seed-based redraw on hover — when the mouse enters, the SVG clears and redraws with a new random seed. This gives a subtle "alive" feeling. On first render the seed is deterministic so there are no hydration mismatches in SSR.

Annotation layer

For text decoration, bydefaulthuman includes an Annotation component built on rough-notation. It supports underline, box, circle, highlight, strike-through, crossed-off, and bracket styles, with three trigger modes:

TriggerBehaviour
mountDraws immediately on first render (default)
inViewDraws once when the element enters the viewport
hoverDraws on mouseenter, resets on mouseleave

Color system

All stroke colours resolve through three CSS custom properties. You can override them per-component via props or on a parent element for section-level theming.

VariableDefaultRole
--cr-strokecurrentColorMain border and annotation stroke
--cr-stroke-muted40% of --cr-strokeSecondary borders, disabled states
--cr-filltransparentInterior fill passed to Rough.js

Pass stroke, strokeMuted, or fill props directly to any component:

<Button stroke="#e85d4a">Red border</Button>
<Card fill="oklch(0.97 0.02 260 / 40%)">Tinted fill</Card>

When to use it

bydefaulthuman is a good fit for personal projects, creative tools, educational apps, indie games, portfolios, and anything that benefits from feeling human-made rather than machine-stamped.