components/rough
Type Aliases
Section titled “Type Aliases”RoughProps
Section titled “RoughProps”RoughProps =
object&HTMLAttributes<HTMLElement>>
Props accepted by Rough.
Type Declaration
Section titled “Type Declaration”mark:
RoughMark
The mark: a box, underline, circle, highlight, speech bubble or line.
optionaltone?:RoughTone
Theme ink (the default) or the coral accent.
optionalseed?:number
Fixes the wobble, so the mark looks the same on every render.
weight?
Section titled “weight?”
optionalweight?:number
Stroke width in CSS pixels.
roughness?
Section titled “roughness?”
optionalroughness?:number
0 is a ruler, 3 is a scribble.
optionalfill?:"none"|"solid"|"hachure"
Fill inside a box, circle or bubble.
optionaltail?:"left"|"right"|"none"
For bubble: the lower corner its tail leaves from.
points?
Section titled “points?”
optionalpoints?:string
For line: percent points in the box, e.g. 0,100 100,0.
animate?
Section titled “animate?”
optionalanimate?:boolean
Draw the mark in once, stroke by stroke, after delay. Skipped for reduced
motion.
delay?
Section titled “delay?”
optionaldelay?:number
Seconds to wait before an animate mark draws in (default 0.2).
block?
Section titled “block?”
optionalblock?:boolean
Render as a block (div) instead of inline (span).
Variables
Section titled “Variables”
constRough:ForwardRefExoticComponent<object&HTMLAttributes<HTMLElement> > &RefAttributes<HTMLElement>>>>
A hand-drawn Rough.js mark (box, underline, circle, highlight, speech bubble or
leader line) around its children, in theme ink or coral. Rough.js loads lazily
after hydration; until then, and without JavaScript, a plain CSS border,
underline or tint stands in. The mark is aria-hidden and never takes pointer
events, so the children keep their focus rings and clicks.
Static pages can write the same attributes (see drawRough) instead of hydrating this component.
References
Section titled “References”RoughMark
Section titled “RoughMark”Re-exports RoughMark
RoughTone
Section titled “RoughTone”Re-exports RoughTone