Skip to content
+

Number Field

A React component for capturing numeric input from users.

Introduction

The Number Field integrates the best of both worlds:

  • Base UI provides unstyled, robust, and fully accessible number field.
  • Material UI components for the visual representation and styles.

It gives developers the flexibility to create various designs while keeping the same foundation for behavior and accessibility. Make sure to install Base UI before continuing the sections below.

npm install @base-ui-components/react

Usage

  1. Pick a demo from below that fits your visual design needs.
  2. Click "Expand code" from the toolbar
  3. Select the file that starts with ./components/
  4. Click the copy icon from the toolbar and paste it into your project.

Outlined field

Uses text-field composition with end adornments for the increment and decrement buttons.

Enter value between 10 and 40

Enter value between 10 and 40

Press Enter to start editing

Spinner field

The increment and decrement buttons are placed next to the outlined input. Best for touch devices and narrow ranges of values.

Press Enter to start editing

Base UI API

See the documentation below for a complete reference to all of the props.

API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.