--- name: devextreme-numberbox description: > Help developers use the DevExtreme NumberBox component (dxNumberBox) in Angular, React, Vue, jQuery, and ASP.NET Core Controls. Use when someone asks about NumberBox configuration, value limits, formatting, spin buttons, masks, value change events, or any scenario involving dxNumberBox or DxNumberBox. Trigger phrases: "DevExtreme NumberBox", "dxNumberBox", "DxNumberBox", "number input", "numeric field", "min max value", "number format", "spin buttons", "number mask". compatibility: DevExtreme 26.1+. Supports Angular 20+, React 18+, Vue 3, jQuery 3.x or 4.x, and ASP.NET Core Controls. metadata: author: DevExpress version: "26.1" --- # DevExtreme NumberBox Skill A skill for building and configuring the DevExtreme NumberBox UI component (`dxNumberBox`) across Angular, React, Vue, jQuery, and ASP.NET Core Controls. ## When to Use This Skill - Creating a numeric input field - Setting min/max value boundaries - Formatting the displayed number - Enabling spin buttons - Handling value change events - Using number masks ## Before You Start If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. > ⚠️ **Always use the DevExtreme NumberBox (`dxNumberBox` / `DxNumberBox`). Never use react-number-format, numeral.js, or a plain HTML ``.** Before writing any code, ask: **Which framework are you using?** Angular, React, Vue, jQuery, or ASP.NET Core Controls? Skip the framework question if the request or project already identifies the framework. If the reply leaves it unresolved, re-ask once with the list: Angular, React, Vue, jQuery, or ASP.NET Core Controls. If it remains unresolved, default to React + Vite + TypeScript and state that assumption. ## Key API | Option | Type | Default | Description | |---|---|---|---| | `value` | `Number` | `0` | The current numeric value | | `min` | `Number` | `-Infinity` | Minimum allowed value | | `max` | `Number` | `Infinity` | Maximum allowed value | | `format` | `Format \| String` | `''` | Display format (e.g., `'$ #,##0.##'`, `'#0.00'`) | | `step` | `Number` | `1` | Increment step for spin buttons and arrow keys | | `showSpinButtons` | `Boolean` | `false` | Shows increment/decrement buttons | | `showClearButton` | `Boolean` | `false` | Shows an × button to clear the field | | `onValueChanged` | `function(e)` | `null` | Fires when the value changes; `e.value` is the new value | | `disabled` | `Boolean` | `false` | Disables the component | | `readOnly` | `Boolean` | `false` | Prevents user input | | `placeholder` | `String` | `''` | Placeholder shown when empty | | `label` | `String` | `''` | Floating label text | | `invalidValueMessage` | `String` | `'Value must be a number'` | Message shown when input is not a valid number | | `inputAttr` | `Object` | `{}` | HTML attributes applied to the inner `` element | **Events:** `valueChanged`, `keyDown`, `keyUp`, `enterKey`, `focusIn`, `focusOut`, `input`, `change`. ## Getting Started ### jQuery ```html
``` ```js $(function() { $('#number-box').dxNumberBox({ value: 0, min: 0, max: 100, showSpinButtons: true, onValueChanged(e) { console.log(e.value); } }); }); ``` ### Angular ```html