Campo numérico de inspetor: arraste o rótulo, o ícone ou o valor para os lados para ajustar, com bloqueio de ponteiro opcional, aceleração conforme a velocidade, um badge que conta a variação e um trilho que mostra onde o valor está dentro do intervalo. Ele continua sendo um campo de texto de verdade: digite um número ou uma expressão (“12*2”, “+=4”), ajuste com as teclas de seta, e uma unidade aparece como sufixo.
Categoria
Formulários
Tipo
Web Component (<mv-scrub-field>)
Status
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 com o servidor MCP do 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.