NumberBox

The NumberBox is a widget that displays a numeric value and allows a user to modify it by typing in a value, and incrementing or decrementing it using the keyboard or mouse.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/number_box
Export: default
NumberBox interactive configuration
Copy Code
Copy to Codepen
$("#numberbox").dxNumberBox({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the NumberBox widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
$(function () {
    $("#numberBox").dxNumberBox({
        value: 20,
        min: 16,
        max: 100,
        placeholder: 'Enter your age'
    });
});
<div id="numberBox"></div>
Angular
HTML
TypeScript
<dx-number-box
    [value]="20"
    [min]="16"
    [max]="100"
    placeholder="Enter your age">
</dx-number-box>
import { DxNumberBoxModule } from 'devextreme-angular';
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxNumberBoxModule
    ],
    // ...
})
AngularJS
HTML
<div dx-number-box="{
    value: 20,
    min: 16,
    max: 100,
    placeholder: 'Enter your age'
}"></div>
Knockout
HTML
<div data-bind="dxNumberBox: {
    value: 20,
    min: 16,
    max: 100,
    placeholder: 'Enter your age'
}"></div>
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().NumberBox()
    .ID("numberBox")
    .Value(20)
    .Min(16)
    .Max(100)
    .Placeholder("Enter your age")
)
@(Html.DevExtreme().NumberBox() _
    .ID("numberBox") _
    .Value(20) _
    .Min(16) _
    .Max(100) _
    .Placeholder("Enter your age")
)

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the NumberBox widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also