Signature Pad
Canvas-based signature capture with smooth strokes, multiple border styles, backgrounds, pen colors and thicknesses, and an imperative API for export, clear, and undo.
Basic Usage
Basic Signature
Sign with mouse, touch, or stylus. Use the ref to export.
import { SignaturePad } from 'fluxo-ui';
import type { SignaturePadHandle } from 'fluxo-ui';
const ref = useRef<SignaturePadHandle>(null);
<SignaturePad ref={ref} onChange={(empty) => setEmpty(empty)} />
<Button label="Export PNG" onClick={() => console.log(ref.current?.toDataURL())} />Borders & Pens
Borders, Backgrounds & Pen Variants
Mix border styles, backgrounds, pen colors, and thicknesses.
<SignaturePad border="dashed" background="grid" />
<SignaturePad border="solid" background="dotted" penColor="#2563eb" thickness="bold" />
<SignaturePad border="none" background="white" thickness="thin" />Import
import { SignaturePad } from 'fluxo-ui';
import type { SignaturePadProps, SignaturePadHandle } from 'fluxo-ui';Props
size'sm' | 'md' | 'lg' | 'full'"'md'"Canvas size preset.
size'sm' | 'md' | 'lg' | 'full'"'md'"Canvas size preset.
border'solid' | 'dashed' | 'none'"'solid'"Border style.
border'solid' | 'dashed' | 'none'"'solid'"Border style.
background'white' | 'transparent' | 'grid' | 'dotted'"'white'"Canvas background pattern.
background'white' | 'transparent' | 'grid' | 'dotted'"'white'"Canvas background pattern.
penColorstring"'#111827'"Ink color.
penColorstring"'#111827'"Ink color.
thickness'thin' | 'regular' | 'bold' | number"'regular'"Pen thickness.
thickness'thin' | 'regular' | 'bold' | number"'regular'"Pen thickness.
showToolbarboolean"true"Show Undo/Clear buttons.
showToolbarboolean"true"Show Undo/Clear buttons.
showSwatchesboolean"false"Show color swatches in the toolbar.
showSwatchesboolean"false"Show color swatches in the toolbar.
swatchesstring[]Custom color swatches.
swatchesstring[]Custom color swatches.
placeholderstring"'Sign here'"Placeholder text shown when empty.
placeholderstring"'Sign here'"Placeholder text shown when empty.
allowTypeModeboolean"true"Show a Draw/Type tab so users who cannot draw can type their name as the signature.
allowTypeModeboolean"true"Show a Draw/Type tab so users who cannot draw can type their name as the signature.
typeFontFamilystring"'Brush Script MT, Lucida Handwriting, Apple Chancery, cursive'"Font family used to render the typed signature on the canvas.
typeFontFamilystring"'Brush Script MT, Lucida Handwriting, Apple Chancery, cursive'"Font family used to render the typed signature on the canvas.
ariaLabelstring"'Signature pad'"Base accessible name for the canvas. Empty/has-signature state is appended automatically.
ariaLabelstring"'Signature pad'"Base accessible name for the canvas. Empty/has-signature state is appended automatically.
onBegin() => voidCalled at stroke start.
onBegin() => voidCalled at stroke start.
onEnd() => voidCalled at stroke end.
onEnd() => voidCalled at stroke end.
onChange(isEmpty: boolean) => voidCalled whenever empty state flips.
onChange(isEmpty: boolean) => voidCalled whenever empty state flips.