Trusted by the world’s leading companies
Overview
The React Numeric Textbox component is a quick replacement of the number-type HTML input element. It’s used to get number inputs from users. It has several out-of-the-box features such as number format support, precision control, and spin buttons.
React Numeric Textbox Code Example
Easily get started with the React Numeric Textbox using a few simple lines of TSX code as demonstrated below. Also explore our React Numeric Textbox Example that shows you how to render and configure the Numeric Textbox in React.
import { createRoot } from 'react-dom/client';
import './index.css';
import * as React from 'react';
import { NumericTextBoxComponent } from '@syncfusion/ej2-react-inputs';
import { SampleBase } from './sample-base';
export class Default extends SampleBase {
render() {
return (
<div style=>
<span className="control-label">Numeric TextBox</span>
<NumericTextBoxComponent value={10}></NumericTextBoxComponent>
</div>
);
}
}
const root = createRoot(document.getElementById('sample'));
root.render(<Default />);Custom formats
The Numeric Textbox supports any custom format. A custom format allows you to place any symbol or text as a prefix or suffix to the input number.
Number precision
You can control the precision of the input number value. And you can limit the precision to any length while the value is being typed.
Spin buttons
Spin buttons provide a flexible option for interacting with the React Numeric Textbox. So you can increase or decrease the input value easily.
You can customize the appearance of the spin buttons. And you can hide the buttons from the component if they are not needed.
Incremental steps
Increment or decrement a value based on a predefined step value. This can help users input large values.
Form support and validation
The React Numeric Textbox has min-max range validation support. This prevents your users from entering out-of-range values.
You can integrate the form validator plugin to perform any custom validation.
HTML5 input type support
The Numeric Textbox component can be extended from the HTML5 tel input. This opens the numeric keypad on mobile devices, which makes it easy to enter numeric values.
Globalization
The React Numeric Textbox component comes with built-in globalization support. It adapts to any culture through simple settings.
Right-to-left (RTL)
The component supports right-to-left (RTL) direction for users working in right-to-left languages like Hebrew, Arabic, or Persian.
Web accessibility
- Fully supports WAI-ARIA accessibility to work with screen readers and assistive devices.
- Follows WAI-ARIA best practices for implementing keyboard interaction.
- Follows the WCAG 2.0 standard in the design of the UI element visuals such as foreground color, background color, line spacing, text, and images.
Developer-friendly APIs
The React Numeric Textbox component has a rich set of developer-friendly APIs. So you can handle all UI elements and behaviors of the control to provide the best experience to your end users.
Not sure how to create your first React Numeric Textbox? Our tutorial videos and documentation can help.
I’d love to watch it now I’d love to read it nowDiscover Syncfusion’s Complete React Component Ecosystem
Explore over 145+ React UI components featuring established, production-ready controls and the latest pure React components built natively for modern web app development.
-
React Components
-
Pure React Components
-
SMART COMPONENTSGRIDSDATA VISUALIZATIONDROPDOWNSFILE VIEWERS & EDITORSBUTTONSINTERACTIVE CHATINPUTSNAVIGATIONFORMSNOTIFICATIONS
-
GRIDSDATA VISUALIZATIONNAVIGATIONINPUTS
Our Customers Love Us
Here are some of their experiences.
Awards
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.