性能
需注意帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 7.6 KB · 运行时 158 KB
Signature padMIT输入框Bencho
由 Lorenzo Cabra 制作的输入框 React 组件。依据 MIT 许可从 Bencho 原样收录,此处为实时预览。
质量报告
等级和分数来自构建或测试时跑过的自动检查。没跑过的项目会标成「未检测」,不会填假数据。
帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 7.6 KB · 运行时 158 KB
问题 0 · 读屏: 通过
没有持续动效
无溢出
帧率和长任务是在无界面的 Chromium 里用软件 WebGL 测的,只适合在本站组件之间比较,不代表真机表现。
不适用:静止时没有可见动画;由悬停触发的动画没有测试。
没有 axe-core 违规。

检测于 2026年11月15日 · 数据来自自动脚本,不是手工填写。
按实际尺寸显示。
复制内容以许可声明开头,使用代码时请保留。
<div id="root"></div>:root{--bg:#f6f4f0;--ink:#17181a;--background:40 20% 96%;--foreground:24 10% 8%;--card:0 0% 100%}html,body{min-height:100%;margin:0;background:var(--bg);color:var(--ink)}html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}#root{display:grid;place-items:center;max-width:100%;max-height:100%;box-sizing:border-box;padding:16px;color:hsl(var(--foreground))}#root.full{width:100%;height:100%;padding:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-play-state:paused!important;transition-duration:0s!important}}
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
/* ── Bencho tokens ─────────────────────────────────────────
The custom properties the free blocks read, at the values
bencho.dev draws them with. Light by default; dark under
[data-theme="dark"] on any ancestor, or automatically with
the system setting unless [data-theme="light"] says otherwise.
Map these to your own theme rather than keeping two: a block
only ever reads the names, never the values. */
:root {
--font-ui: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
--bg: #ffffff;
--board: #ffffff;
--card: #f7f7f6;
--surface: #f7f7f6;
--surface-2: #f1f1f0;
--surface-3: #ecebe7;
--ink: #17181a;
--ink-rgb: 23, 24, 26;
--ink-2: #3c3b37;
--ink-3: #5c5b56;
--ink-4: #6f6e68;
--ink-5: #85847e;
--on-ink: #ffffff;
--on-ink-rgb: 255, 255, 255;
--slab: #17181a;
--on-slab: #ffffff;
--slab-dark: #0e0f11;
--fill-slab: #ffffff;
--fill-on: #17181a;
--fill-on-rgb: 23, 24, 26;
--pane: var(--fill-slab);
--pane-edge: rgba(23, 24, 26, 0.08);
--pane-thumb: rgba(23, 24, 26, 0.07);
--inlay: rgba(255, 255, 255, 0.55);
--inlay-hi: rgba(23, 24, 26, 0.09);
--elev-rgb: 255, 255, 255;
--glass-rgb: 255, 255, 255;
--shadow-rgb: 23, 24, 26;
--wash: 0.06;
--pick: #0d99ff;
--signal: #2231dd;
--focus: #2231dd;
--ok: #15803d;
--ember: #b8431c;
color-scheme: light;
}
[data-theme="dark"] {
--bg: #000000;
--board: #1a1a1a;
--card: #0a0a0a;
--surface: #0f0f0f;
--surface-2: #181818;
--surface-3: #202020;
--ink: #ffffff;
--ink-rgb: 255, 255, 255;
--ink-2: #b4b4b4;
--ink-3: #9a9a9a;
--ink-4: #828282;
--ink-5: #6b6b6b;
--on-ink: #000000;
--on-ink-rgb: 0, 0, 0;
--slab: #1a1a1a;
--on-slab: #ffffff;
--slab-dark: #262626;
--fill-slab: #262626;
--fill-on: #ffffff;
--fill-on-rgb: 255, 255, 255;
--pane-edge: rgba(255, 255, 255, 0.08);
--pane-thumb: rgba(255, 255, 255, 0.07);
--inlay: rgba(255, 255, 255, 0.1);
--inlay-hi: rgba(255, 255, 255, 0.09);
--elev-rgb: 32, 32, 32;
--shadow-rgb: 0, 0, 0;
--wash: 0.09;
--pick: #3aa9ff;
--ok: #34d17a;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #000000;
--board: #1a1a1a;
--card: #0a0a0a;
--surface: #0f0f0f;
--surface-2: #181818;
--surface-3: #202020;
--ink: #ffffff;
--ink-rgb: 255, 255, 255;
--ink-2: #b4b4b4;
--ink-3: #9a9a9a;
--ink-4: #828282;
--ink-5: #6b6b6b;
--on-ink: #000000;
--on-ink-rgb: 0, 0, 0;
--slab: #1a1a1a;
--on-slab: #ffffff;
--slab-dark: #262626;
--fill-slab: #262626;
--fill-on: #ffffff;
--fill-on-rgb: 255, 255, 255;
--pane-edge: rgba(255, 255, 255, 0.08);
--pane-thumb: rgba(255, 255, 255, 0.07);
--inlay: rgba(255, 255, 255, 0.1);
--inlay-hi: rgba(255, 255, 255, 0.09);
--elev-rgb: 32, 32, 32;
--shadow-rgb: 0, 0, 0;
--wash: 0.09;
--pick: #3aa9ff;
--ok: #34d17a;
color-scheme: dark;
}
}
/* Signature.css */
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
/* ══ Signature pad ════════════════════════════════════════ */
.sig-frame { display: grid; place-items: center; }
.sig {
position: relative;
flex: none;
/* folding into the pill, and opening back out: one long
quint-out glide, no overshoot — a card this size bouncing
read as a jolt, not a landing */
transition:
width 600ms cubic-bezier(0.22, 1, 0.36, 1),
height 600ms cubic-bezier(0.22, 1, 0.36, 1),
border-radius 600ms cubic-bezier(0.22, 1, 0.36, 1);
border-radius: var(--r);
overflow: hidden;
background: var(--fill-slab, var(--card));
color: var(--fill-on, var(--ink));
font-family: var(--font-ui);
touch-action: none;
user-select: none;
-webkit-user-select: none;
cursor: crosshair;}
[data-stroke="on"] .sig { box-shadow: inset 0 0 0 1px var(--pane-edge); }
.sig-ink {
position: absolute; inset: 0; pointer-events: none; overflow: visible;
--sig-c: var(--fill-on, var(--ink));
color: var(--sig-c);
transition: color 260ms ease;}
.sig[data-ink="Blue"] .sig-ink { --sig-c: #2446d8; }
[data-fill="dark"] .sig[data-ink="Blue"] .sig-ink { --sig-c: #7d95ff; }
/* signed, and held: the ink settles to a soft tint of itself before
the pad folds it away */
.sig[data-settled] .sig-ink { color: color-mix(in srgb, var(--sig-c) 30%, var(--fill-slab, var(--card))); }
.sig-line {
position: absolute;
height: 1px;
background: currentColor;
opacity: 0.16;
pointer-events: none;}
.sig-hint {
position: absolute;
top: 140px;
font-size: 12px;
font-weight: 400;
pointer-events: none;
letter-spacing: 0em;}
.sig-hint {
left: 0;
right: 0;
text-align: center;
opacity: 0.38;
transition: opacity 220ms ease;}
.sig[data-inked] .sig-hint { opacity: 0; }
/* signed: the signature shrinks WITH the card, on the same
curve, into the middle of the pill — and fades as it goes, so
by the time it would be too small to read it is gone */
.sig[data-signed] { cursor: default; }
.sig-face {
position: absolute;
left: 50%;
top: 50%;
width: 300px;
height: 180px;
translate: -50% -50%;
transition: scale 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease 220ms;}
.sig[data-signed] .sig-face {
scale: 0.35;
opacity: 0;
transition: scale 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease 160ms;}
.sig[data-settled] :is(.sig-clear, .sig-hint) { opacity: 0; transition: opacity 160ms ease; }
.sig[data-settled] .sig-line { opacity: 0.08; transition: opacity 420ms ease; }
.sig-said {
position: absolute;
inset: 0;
display: grid;
place-items: center;
pointer-events: none;}
.sig-pill {
display: flex;
align-items: center;
gap: 8px;
height: 100%;
width: 100%;
justify-content: center;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
font-size: 13px;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
pointer-events: auto;
-webkit-tap-highlight-color: transparent;
/* in once the pill has nearly arrived */
animation: sig-said 320ms ease 420ms both;
letter-spacing: 0em;}
.sig-pill:focus-visible { outline: 2px solid var(--signal, #2231dd); outline-offset: 2px; border-radius: 999px; }
.sig-check {
color: #1f9d55;
animation: sig-check 420ms cubic-bezier(0.3, 1.6, 0.4, 1) 460ms both;}
.sig-clear {
position: absolute;
top: 10px;
right: 10px;
height: 28px;
padding: 0 12px;
border: 0;
border-radius: var(--inner);
background: color-mix(in srgb, currentColor 7%, transparent);
color: inherit;
font: inherit;
font-size: 12px;
font-weight: 500;
cursor: pointer;
opacity: 0;
scale: 0.9;
pointer-events: none;
-webkit-tap-highlight-color: transparent;
transition: opacity 160ms ease, scale 220ms cubic-bezier(0.24, 1.34, 0.38, 1), background 160ms ease;
letter-spacing: 0em;}
.sig[data-inked] .sig-clear { opacity: 1; scale: 1; pointer-events: auto; }
.sig-clear:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.sig-clear:active { scale: 0.96; }
.sig-clear:focus-visible { outline: 2px solid var(--signal, #2231dd); outline-offset: 2px; }
@keyframes sig-said { from { opacity: 0; } }
@keyframes sig-check { from { opacity: 0; scale: 0.3; rotate: -20deg; } }
// bencho source (MIT). npm i @tabler/icons-react motion react · Tailwind CSS v4
// ── blocks/signature/Signature.tsx (https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/signature/Signature.tsx)
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
import { useEffect, useRef, useState } from "react";
import { IconCheck as Check } from "@tabler/icons-react";
/* ══ Signature pad ════════════════════════════════════════
Sign on the line. The ink thins as the pen moves faster and
pools as it slows, the way a real nib does — which is most
of what makes a scribble read as a signature rather than a
trace of the mouse.
── AND THEN IT GETS OUT OF THE WAY ─────────────────────
Pause after the last stroke and the pad folds itself into a
small pill that says Signed — the whole card shrinking into
the confirmation, rather than a line of small print under
the signature. Press the pill to sign again.
── CLEAR REWINDS ───────────────────────────────────────
Clear does not wipe. The ink un-draws, last point first, all
the way back to the first touch — the signature taken back
in the order it was given.
── SVG, NOT A CANVAS ───────────────────────────────────
Every segment is its own short curve with its own width. A
canvas would need its pixel ratio guessed for a block the
wall draws at 0.8 and the overlay at 1.4, and would not
follow the Fill control without being told to repaint; an
SVG is crisp at any scale and its ink is currentColor. */
/* the pen lifts: the ink softens this soon after, and the pad folds
away at FOLD_MS if the pen has not come back. A new stroke in
between brings the ink straight back to full strength */
const SOFT_MS = 220;
const FOLD_MS = 1500;
const W = 300;
const H = 180;
/* where the line is, in the block's own pixels */
const LINE_Y = 128;
const INSET = 28;
/* what the pad folds into */
const PILL_W = 112;
const PILL_H = 40;
type Pt = { x: number; y: number; w: number };
const clamp = (v: number, a: number, b: number) => Math.min(b, Math.max(a, v));
const ease = (k: number) => (k < 0.5 ? 2 * k * k : 1 - Math.pow(-2 * k + 2, 2) / 2);
/* one stroke as short quadratic pieces through the midpoints,
each as wide as the pen was there */
function pieces(s: Pt[], upto: number, key: string) {
const out: React.ReactNode[] = [];
const n = Math.min(s.length, upto);
if (n <= 0) return out;
if (n === 1 || s.length === 1) {
out.push(<circle key={key} cx={s[0].x} cy={s[0].y} r={s[0].w / 2} fill="currentColor" />);
return out;
}
for (let i = 1; i < n; i++) {
const a = s[i - 1];
const b = s[i];
const start = i === 1 ? a : { x: (s[i - 2].x + a.x) / 2, y: (s[i - 2].y + a.y) / 2 };
const end = i === s.length - 1 ? b : { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
out.push(
<path
key={`${key}-${i}`}
d={`M${start.x.toFixed(1)} ${start.y.toFixed(1)}Q${a.x.toFixed(1)} ${a.y.toFixed(1)} ${end.x.toFixed(1)} ${end.y.toFixed(1)}`}
strokeWidth={((a.w + b.w) / 2).toFixed(2)}
/>,
);
}
return out;
}
export function Signature({
/* how heavy the pen is, 0..100 */
pen = 50,
/* how much the hand's wobble is taken out, 0..100 */
smooth = 50,
ink = "Black",
/* how fast Clear un-draws, 0..100 */
rewind = 50,
corner = 20,
}: {
pen?: number;
smooth?: number;
ink?: string;
rewind?: number;
corner?: number;
} = {}) {
const pad = useRef<HTMLDivElement>(null);
const strokes = useRef<Pt[][]>([]);
const [, setV] = useState(0);
const redraw = () => setV((v) => v + 1);
const [cut, setCut] = useState<number | null>(null);
const [signed, setSigned] = useState(false);
/* the beat between: the pause has said it is done, the ink has
softened to a tint, and the pad has not yet folded away */
const [settled, setSettled] = useState(false);
const down = useRef(false);
const last = useRef({ x: 0, y: 0, t: 0, w: 0 });
const later = useRef(0);
const raf = useRef(0);
const knobs = useRef({ pen, smooth, rewind });
knobs.current = { pen, smooth, rewind };
const fold = useRef(0);
useEffect(() => () => {
clearTimeout(fold.current);
clearTimeout(later.current);
cancelAnimationFrame(raf.current);
}, []);
/* the pen's two widths, both of which move with the knob so
neither end of it is a pen that cannot vary */
const widths = () => {
const p = clamp(knobs.current.pen, 0, 100) / 100;
return { thin: 0.8 + p * 2, thick: 2.2 + p * 5 };
};
/* the pointer, in the block's own pixels — the block is drawn
scaled on the wall and in the overlay */
const local = (e: React.PointerEvent) => {
const r = pad.current!.getBoundingClientRect();
return { x: ((e.clientX - r.left) * W) / r.width, y: ((e.clientY - r.top) * H) / r.height };
};
const rewinding = cut !== null;
const total = strokes.current.reduce((n, s) => n + s.length, 0);
const inked = total > 0;
const onDown = (e: React.PointerEvent<HTMLDivElement>) => {
if (rewinding || signed) return;
try { e.currentTarget.setPointerCapture(e.pointerId); } catch { /* a scripted pointer */ }
down.current = true;
clearTimeout(later.current);
clearTimeout(fold.current);
setSigned(false);
/* pen back on the pad before it folded: the ink comes back too */
setSettled(false);
const p = local(e);
const { thin, thick } = widths();
const w = (thin + thick) / 2;
last.current = { ...p, t: performance.now(), w };
strokes.current.push([{ ...p, w }]);
redraw();
};
const onMove = (e: React.PointerEvent<HTMLDivElement>) => {
if (!down.current) return;
const raw = local(e);
const l = last.current;
/* smoothing: the pen follows the hand on a lag */
const k = 1 - (clamp(knobs.current.smooth, 0, 100) / 100) * 0.75;
const x = l.x + (raw.x - l.x) * k;
const y = l.y + (raw.y - l.y) * k;
const d = Math.hypot(x - l.x, y - l.y);
if (d < 0.8) return;
const t = performance.now();
const v = d / Math.max(1, t - l.t);
const { thin, thick } = widths();
/* fast is thin, slow pools; and the width itself eases, so
a single quick frame cannot make a notch in the line */
const target = thick - (thick - thin) * clamp(v / 1.6, 0, 1);
const w = l.w + (target - l.w) * 0.35;
last.current = { x, y, t, w };
strokes.current[strokes.current.length - 1].push({ x, y, w });
redraw();
};
const onUp = (e: React.PointerEvent<HTMLDivElement>) => {
try { e.currentTarget.releasePointerCapture(e.pointerId); } catch { /* never captured */ }
if (!down.current) return;
down.current = false;
clearTimeout(later.current);
clearTimeout(fold.current);
fold.current = window.setTimeout(() => {
if (!down.current && strokes.current.length) setSettled(true);
}, SOFT_MS);
later.current = window.setTimeout(() => {
if (!down.current && strokes.current.length) {
/* a pause after the last stroke is what signing IS: the
softened ink shrinks away as the pad folds into the pill */
setSigned(true);
}
}, FOLD_MS);
};
const clear = () => {
if (!inked || rewinding) return;
clearTimeout(later.current);
clearTimeout(fold.current);
setSigned(false);
setSettled(false);
const n = total;
const per = 2 + ((100 - clamp(knobs.current.rewind, 0, 100)) / 100) * 8;
const dur = clamp(n * per, 350, 2400);
const t0 = performance.now();
const step = (t: number) => {
const k = Math.min(1, (t - t0) / dur);
setCut(Math.round(n * (1 - ease(k))));
if (k < 1) {
raf.current = requestAnimationFrame(step);
return;
}
strokes.current = [];
setCut(null);
};
raf.current = requestAnimationFrame(step);
};
/* the pill, pressed: the ink goes while nobody can see it,
and the pad opens back out empty */
const again = () => {
strokes.current = [];
setSigned(false);
setSettled(false);
};
/* draw up to the cut, stroke by stroke */
const ink$: React.ReactNode[] = [];
let left = cut ?? Infinity;
strokes.current.forEach((s, i) => {
if (left <= 0) return;
ink$.push(...pieces(s, left, String(i)));
left -= s.length;
});
const r = clamp(corner, 0, 28);
/* the Clear pill sits 10 in: concentric once there is a curve */
const inner = Math.max(0, r - 10 * Math.min(1, r / 20));
return (
/* a fixed frame, so folding into the pill never rescales
the block on the wall */
<div className="sig-frame" style={{ width: W, height: H }}>
<div
ref={pad}
className="sig"
data-ink={ink}
data-inked={(inked && !rewinding && !signed && !settled) || undefined}
data-settled={(settled || signed) || undefined}
data-signed={signed || undefined}
style={{
/* width and height, never a scale: the corner has to stay
a corner all the way down to the pill */
width: signed ? PILL_W : W,
height: signed ? PILL_H : H,
"--r": signed ? `${PILL_H / 2}px` : `${r}px`,
"--inner": `${Math.min(14, inner)}px`,
} as React.CSSProperties}
onPointerDown={onDown}
onPointerMove={onMove}
onPointerUp={onUp}
onPointerCancel={onUp}
onContextMenu={(e) => e.preventDefault()}
>
{/* everything drawn on the pad, on one layer centred in the
card: signing, it shrinks with the card into the pill's
middle instead of being cut off by its edges */}
<div className="sig-face">
<span className="sig-line" style={{ top: LINE_Y, left: INSET, right: INSET }} aria-hidden="true" />
<span className="sig-hint" aria-hidden="true">Sign here</span>
<svg
className="sig-ink"
viewBox={`0 0 ${W} ${H}`}
width={W}
height={H}
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
role="img"
aria-label={inked ? "Signature" : "Empty signature pad"}
>
{ink$}
</svg>
</div>
<button
type="button"
className="sig-clear"
tabIndex={inked && !rewinding && !signed && !settled ? 0 : -1}
onPointerDown={(e) => e.stopPropagation()}
onClick={clear}
>
Clear
</button>
<span className="sig-said" aria-live="polite">
{signed && (
<button
type="button"
className="sig-pill"
aria-label="Signed. Sign again"
onPointerDown={(e) => e.stopPropagation()}
onClick={again}
>
<Check size={14} strokeWidth={2} className="sig-check" />
Signed
</button>
)}
</span>
</div>
</div>
);
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
可见的标签、安静的边框和清楚的焦点状态引导输入。
搜索、登录和短文本字段。
调高度、边框颜色和焦点光晕。
把 Bencho (github.com/cabralorenzo/bencho)(MIT)中的「签名板」组件加入我的 React + Tailwind CSS 应用。源文件:https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/signature/Signature.tsx。可见的标签、安静的边框和清楚的焦点状态引导输入。 适用场景:搜索、登录和短文本字段。 可调参数:调高度、边框颜色和焦点光晕。 支持浅色与深色主题,遵循 prefers-reduced-motion。保留 MIT 许可声明。
更完整的提示词,包含调参、无障碍和接入步骤。