Zahlenfeld für Inspektoren: Ziehe sein Label, Icon oder seinen Wert seitwärts, um zu scrubben, mit optionalem Pointer Lock, geschwindigkeitsabhängiger Beschleunigung, einem Badge, das die Änderung zählt, und einer Schiene, die zeigt, wo der Wert in seinem Bereich liegt.
So funktioniert es
Zahlenfeld wie im Inspector: Zieh sein Label, Icon oder seinen Wert seitwärts, um zu scrubben, mit optionalem Pointer Lock, geschwindigkeitsabhängiger Beschleunigung, einem Badge, das die Änderung zählt, und einer Schiene, die zeigt, wo der Wert in seinem Bereich liegt. Es bleibt ein echtes Textfeld: Tipp eine Zahl oder einen Ausdruck ein („12*2“, „+=4“), ändere den Wert schrittweise mit den Pfeiltasten, und eine Einheit erscheint als Suffix.
Kategorie
Formulare
Typ
Web Component (<mv-scrub-field>)
Status
stabil
Keywords
scrub, number, inspector, spinbutton, pointer-lock, expression, unit, form-associated, editor
When to use
A design-tool inspector needs compact numeric fields for size, spacing or opacity that can be dragged
Users type expressions like 12*2 or +=4 and see a unit suffix such as px or ms
Many numeric properties must fit in a dense side panel
Avoid when
The form targets general users who expect visible - and + buttons → use Number Field instead
Several linked values like X/Y or width/height are edited together → use Vector Field instead
It is a shopping quantity with stock limits → use Quantity instead
Generated parts (the rail appears when both min and max are set).
mv-scrub-field-cursor
Virtual cursor appended to <body> only while the pointer is locked.
CSS variables
Name
Standard
Beschreibung
--mv-scrub-field-width
6.5rem
Width.
--mv-scrub-field-height
var(--mv-control-sm)
Height.
--mv-scrub-field-bg
Field background.
--mv-scrub-field-radius
var(--mv-radius-sm)
Radius.
Accessibility
The value is a real text input with role="spinbutton", aria-valuenow/min/max and an aria-valuetext that includes the unit. It is named by its label (<label for>), aria-label or an external <label>. Keyboard: ↑/↓ (Shift ×10, Alt ×0.1), PageUp/PageDown, Home/End when not typing, Enter to commit, Escape to cancel an edit or a drag. An invalid expression is flagged with aria-invalid. The system cursor is never hidden unless the browser grants pointer lock, when a virtual cursor replaces it. Dragging the value itself is for mouse and pen; on touch, drag the handle and tap the value to type. Motion (step nudge, error shake) is skipped under reduced motion, and forced-colors mode uses system colors for the frame, rail, badge and cursor.