E-Signature
A token-styled signature capture with a draw mode (signature_pad canvas with clear/undo) and a type mode (script-rendered typed name), writing a PNG data URL or typed value to a hidden input for form submit.
Preview
Draw your signature in the box below.
<div class="mx-auto w-full max-w-lg">
<x-ui.e-signature name="signature" />
</div>
Installation
php artisan ui:add pro/e-signature
Note
This component ships an Alpine behavior module at
resources/js/ui/e-signature.js. Import it once from your bundle so it registers on alpine:init:
import './e-signature.js';
Use with AI
A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.
# Brok UI: E-Signature (`e-signature`)
A token-styled signature capture with a draw mode (signature_pad canvas with clear/undo) and a type mode (script-rendered typed name), writing a PNG data URL or typed value to a hidden input for form submit.
Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.
## Install
```bash
php artisan ui:add pro/e-signature
```
## Usage
```blade
<div class="mx-auto w-full max-w-lg">
<x-ui.e-signature name="signature" />
</div>
```
## Use when
- Use when users need to upload, inspect, edit, annotate, or sign real documents as part of the workflow.
- Capturing a signature for a document or agreement directly in the browser, either drawn or typed.
- Needing the captured signature to submit as part of a plain HTML form.
## Avoid when
- Do not use a heavy document interface when the same task can be completed more simply in structured product UI.
- Use only for a real signing task with clear consent, document context, completion state, and a recoverable review path.
- A legally binding, auditable e-signature workflow with identity verification is required; integrate a dedicated e-signature provider instead.
- Only a checkbox-style agreement is needed, with no visual signature; use checkbox.
## Anti-patterns
- Heavy document UI when structured fields are simpler
## Rules
- Use the `<brok:e-signature>` tag (or `<x-ui.e-signature>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.
## Links
- Docs: https://brokui.dev/docs/components/e-signature
Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.
API
Props
No documented props. Pass normal Blade attributes through the component root.
Slots
default—
Data slots
Stable hooks for CSS overrides and browser tests.
No data-slot selectors found in the registry source.
Behavior
- Draw mode uses signature_pad on a canvas, with clear and undo controls; type mode renders the typed name in a script font as a live preview.
- Switching between draw and type modes is a tablist; only the active mode's input is shown.
- The current signature, a PNG data URL from draw mode or the typed text from type mode, is written to a hidden input so it submits with a plain HTML form.
- Installs a JavaScript behavior module when the registry item includes resources/js/ui files.
Guidance
Upload, inspect, edit, annotate, or sign a real document.
Use when
- Use when users need to upload, inspect, edit, annotate, or sign real documents as part of the workflow.
- Capturing a signature for a document or agreement directly in the browser, either drawn or typed.
- Needing the captured signature to submit as part of a plain HTML form.
Avoid when
- Do not use a heavy document interface when the same task can be completed more simply in structured product UI.
- Use only for a real signing task with clear consent, document context, completion state, and a recoverable review path.
- A legally binding, auditable e-signature workflow with identity verification is required; integrate a dedicated e-signature provider instead.
- Only a checkbox-style agreement is needed, with no visual signature; use checkbox.
Use instead
- Structured product form
- Direct data entry
Anti-patterns
- Heavy document UI when structured fields are simpler
- Anatomy
Accessibility
- Keyboard
- No component-owned keyboard interaction; native element behavior applies.
- Focus
none
- The mode toggle follows the WAI-ARIA tablist pattern (role="tablist" with an accessible label), so switching between draw and type is announced clearly.
- Type mode's live preview gives keyboard-only users a way to produce a signature without drawing on the canvas.
- Semantic HTML and a stable
data-slotattribute for styling and scripting hooks. - Focus-visible rings use the
ringtoken, so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
- Labels go through
__()and layout uses logical properties (ms-*,text-start), so it mirrors underdir="rtl"— flip the preview to RTL to confirm. - Dark mode uses the same semantic tokens under the
darkclass; high contrast follows forced-color system tokens.
Livewire
Livewire can update this component through forwarded wire:* attributes.
Source
Source available with Pro
This preview shows the real Pro component, while its installable source is delivered only through the authenticated registry. Activate a license, then use the installation command above.
Open the authenticated source endpoint
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.1.0 - Status
- Stable
- License
-
pro - Accessibility reviewed
- No review date recorded
- Last breaking change
- No date recorded
- Deprecation
- Not deprecated