A signature that writes itself in ink, or a pad your visitors sign
| Name | Type | Default | Description |
|---|---|---|---|
mode | "play" | "sign" | "play" | Play writes a signature in ink. Sign turns the card into a pad your visitors sign with a mouse, pen or finger. |
strokes | { x, y, t?, p? }[][] | a built-in signature | The signature to write in play mode. Points with t are replayed with their own timing, like strokes saved from sign mode. Points without t are smoothed through and timed like a real pen. |
pen | "fountain" | "ballpoint" | "marker" | "fountain" | Fountain pens swell on downstrokes and thin on upstrokes. Ballpoints stay even. Markers are bold and round. |
thickness | number | 1 | Scales the width of the ink. |
speed | number | 1 | How fast the signature writes itself. |
autoplay | boolean | true | Writes the signature the first time it scrolls into view. Off shows it already written. |
loop | boolean | false | Writes the signature again after a pause. |
pause | number | 2400 | Milliseconds to wait before writing again when looping. |
frame | boolean | true | Sits the signature on a soft card. Off places it straight on the page, like the end of a letter. |
line | boolean | true | The line the signature sits on. |
name | string | — | Printed name under the line. |
role | string | — | Muted text beside the name, like a title or company. |
placeholder | string | "Sign here" | Hint shown in the middle of the pad in sign mode until the first stroke. |
aspect | number | 2.4 | Width to height ratio of the card. |
intro | boolean | true | The card fades in and the line draws across before the first stroke. |
theme | "auto" | "light" | "dark" | "auto" | Auto matches the ink and card to the background behind it. |
inkColor | string | blue black | Colour of the ink. |
surfaceColor | string | faint tint | Colour of the card. |
onChange | (strokes) => void | — | Called after each stroke in sign mode with every stroke so far. Pass them back as strokes to replay a signature later. |
onComplete | () => void | — | Called when the signature finishes writing in play mode. |
ref | { play, clear, undo, getStrokes, toSVG, toDataURL } | — | Replays, clears or undoes from your own code, and exports the signature as SVG markup or a PNG data URL. |
className | string | — | Classes for the root element. |
style | CSSProperties | — | Inline styles for the root element. |
mode"play" | "sign"Play writes a signature in ink. Sign turns the card into a pad your visitors sign with a mouse, pen or finger.
"play"strokes{ x, y, t?, p? }[][]The signature to write in play mode. Points with t are replayed with their own timing, like strokes saved from sign mode. Points without t are smoothed through and timed like a real pen.
a built-in signaturepen"fountain" | "ballpoint" | "marker"Fountain pens swell on downstrokes and thin on upstrokes. Ballpoints stay even. Markers are bold and round.
"fountain"thicknessnumberScales the width of the ink.
1speednumberHow fast the signature writes itself.
1autoplaybooleanWrites the signature the first time it scrolls into view. Off shows it already written.
trueloopbooleanWrites the signature again after a pause.
falsepausenumberMilliseconds to wait before writing again when looping.
2400framebooleanSits the signature on a soft card. Off places it straight on the page, like the end of a letter.
truelinebooleanThe line the signature sits on.
truenamestringPrinted name under the line.
—rolestringMuted text beside the name, like a title or company.
—placeholderstringHint shown in the middle of the pad in sign mode until the first stroke.
"Sign here"aspectnumberWidth to height ratio of the card.
2.4introbooleanThe card fades in and the line draws across before the first stroke.
truetheme"auto" | "light" | "dark"Auto matches the ink and card to the background behind it.
"auto"inkColorstringColour of the ink.
blue blacksurfaceColorstringColour of the card.
faint tintonChange(strokes) => voidCalled after each stroke in sign mode with every stroke so far. Pass them back as strokes to replay a signature later.
—onComplete() => voidCalled when the signature finishes writing in play mode.
—ref{ play, clear, undo, getStrokes, toSVG, toDataURL }Replays, clears or undoes from your own code, and exports the signature as SVG markup or a PNG data URL.
—classNamestringClasses for the root element.
—styleCSSPropertiesInline styles for the root element.
—