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({
});

You can create the widget using one of the following approaches.

jQuery
JavaScript
HTML
$(function () {
    $("#numberBox").dxNumberBox({
        value: 20,
        min: 16,
        max: 100,
        placeholder: 'Enter your age'
    });
});
<div id="numberBox"></div>
Angular
HTML
<dx-number-box
    [value]="20"
    [min]="16"
    [max]="100"
    placeholder="Enter your age">
</dx-number-box>
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")
)

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

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