Campo numérico de inspector: arrastra su etiqueta, icono o valor hacia los lados para ajustarlo, con bloqueo de puntero opcional, aceleración según la velocidad, una insignia que cuenta el cambio y un carril que muestra dónde está el valor dentro de su rango. Sigue siendo un campo de texto real: escribe un número o una expresión (“12*2”, “+=4”), avanza con las teclas de flecha, y una unidad aparece como sufijo.
Categoría
Formularios
Tipo
Web Component (<mv-scrub-field>)
Estado
beta
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
Agente de IA con el servidor MCP de Marvelous UI: install_components({ slugs: ["scrub-field"], target_dir: "<absolute path>/src/marvelous", framework: "react" }).
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
Default
Description
--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.