Skip to main content
← Back to Table of Contents

Summary

Canvas signature pad storing normalized SVG markup. Supports undo, fullscreen, optional download (SVG/WebP), and stroke validation.

Mobile, touch & stylus (enterprise)

SignatureField uses the Pointer Events API — one code path for mouse, finger, and active stylus: Toolbar icon buttons expose Filament tooltips (same copy as aria-label) and use larger hit targets on coarse pointers (@media (pointer: coarse)). Note: passive capacitive styluses (no pressure, reported as touch) behave like finger input. Only one pointer draws a stroke at a time. Hardware palm rejection depends on the device and browser.

Basic usage

Read-only preview of an existing signature:

State format

State is a compact SVG string produced by SignatureSvg::normalize(). null or empty string means no signature. Use normalizeState(mixed $state): ?string to sanitize external SVG before setting state. Enterprise e-sign metadata via Media Ingress:
On save, legalMetadataIn receives: legalPack() requires visible ink (SignatureLegalPack::requiresInk()).

Validation

Configuration API

penColor(string|Closure $color)

Hex pen color. Default: #18181b. Must match #RGB or #RRGGBB.

penWidth(float|Closure $width)

Stroke width in SVG units. Clamped to 0.5–12. Default: 5.6.

backgroundColor(string|Closure|null $color)

Canvas background hex, or null / 'transparent' for transparent. Default: #ffffff. When left at the default, the pad follows Filament dark mode in the UI (dark zinc pad, light ink) while exported SVG/WebP still uses a white background for document output. Set an explicit hex to lock both display and export.

fullscreen(bool|Closure $condition = true)

Enable fullscreen drawing mode. Default: true.

undoable(bool|Closure $condition = true)

Show undo control. Default: true.

maxSizeKb(int|Closure $kilobytes)

Maximum stored SVG size in kilobytes. Default: 48.

minStrokes(int|Closure $strokes)

Minimum number of SVG paths required. Default: 1.

viewBox(int|Closure $width, int|Closure $height)

SVG viewBox dimensions. The default is 600 × 260. Existing SVG signatures are fitted proportionally when displayed in a different pad size.

smoothing(bool|Closure $condition = true)

Streamlined, variable-width ink with rounded joins and tapered ends. Pen pressure controls active stylus width; mouse and finger input use simulated pressure. Default: true.

trackpadGlide(bool|Closure $condition = true)

Hold modifier key to draw with trackpad without clicking. Default: false.

trackpadGlideKey(string|Closure $key)

Single letter a–z for glide modifier. Default: d.

guidelines(bool|Closure $condition = true)

Show baseline guidelines on canvas. Default: false.

downloadable(string|Closure|null $format = 'svg')

Enable client-side download. Formats: SignatureField::DOWNLOAD_SVG or SignatureField::DOWNLOAD_WEBP. Pass null to disable.

downloadFilename(string|Closure $filename)

Download file base name without extension. Default: signature.

webpQuality(float|Closure $quality)

WebP export quality 0.1–1. Default: 0.9.

undoIcon() / clearIcon() / downloadIcon() / fullscreenIcon() / closeIcon()

Override toolbar icons (string|BackedEnum|Htmlable|Closure|null).

readOnly(bool|Closure $condition = true)

Disable drawing; display existing SVG only.

Public helper methods

FlexField schema config

CSS classes

Implementation notes

  • Store SVG in text or longText columns; consider maxSizeKb() for DB limits.
  • WebP download is generated client-side from the canvas — not stored in form state.

Playground

Slug: signature-field /admin/flex-fields/signature-field — see Playground.

Ink controls, redo and replay

Choose the colors and stroke widths available in the pad:
Color and width changes affect new strokes. Undo and redo preserve each stroke’s settings. Replay animates the existing signature without changing the saved value. Use replayable(false) to hide replay. The history retains up to 60 changes. Clearing the pad animates the ink away and can be undone; reduced-motion preferences disable this effect. Replay follows the pen points preserved in signatures exported by the field. Imported filled SVG images without pen-point history can still be displayed, edited and downloaded, but their original drawing order cannot be recovered; the replay control is disabled for those images.
Last modified on October 16, 2026