React NumberBox - Control the Behavior
If you need to add spin buttons to the NumberBox, set the showSpinButtons to true.
App.js
- import React from 'react';
- import 'devextreme/dist/css/dx.fluent.blue.light.css';
- import NumberBox from 'devextreme-react/number-box';
- export default function App() {
- return (
- <NumberBox
- defaultValue={20}
- showSpinButtons={true} />
- );
- }
To specify the step by which the value is changed, use the step property.
App.js
- import React from 'react';
- import 'devextreme/dist/css/dx.fluent.blue.light.css';
- import NumberBox from 'devextreme-react/number-box';
- export default function App() {
- return (
- <NumberBox
- defaultValue={20}
- showSpinButtons={true}
- step={10} />
- );
- }