Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/data/material/components/number-field/number-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ components: Button, IconButton, InputLabel, FormControl, FormLabel, FormHelperTe

{{"component": "@mui/docs/ComponentLinkHeader"}}

Number Field is _not_ a built-in `@mui/material` component—it's composed of a [Base UI Number Field](https://base-ui.com/react/components/number-field) and styled to align with Material UI specs.
A number field is an input with increment and decrement buttons for capturing numeric input from users.

Material UI does not include a number field component out of the box, but this page provides components composed with the [Base UI `NumberField`](https://base-ui.com/react/components/number-field) and styled to align with Material Design (MD2) specifications, so they can be used with Material UI.

As such, you must install Base UI before proceeding.
The examples that follow can then be copied and pasted directly into your app.
Note that Base UI is tree-shakeable, so the final bundle will only include the components used in your project.

## Installation

<!-- #npm-tag-reference -->

<codeblock storageKey="package-manager">
Expand Down Expand Up @@ -43,7 +47,7 @@ yarn add @base-ui-components/react

## Outlined field

The outlined field component uses [text-field composition](/material-ui/react-text-field/#components) with end adornments for the increment and decrement buttons.
The outlined field component uses [`TextField` composition](/material-ui/react-text-field/#components) with end adornments for the increment and decrement buttons.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siriwatknp can you elaborate on what this means ("uses text field composition")? I read the section of the doc linked here and it wasn't clear to me how these two are connected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention is to show how to achieve outlined TextField-like with the breakdown components. I bring up TextField (even though it's not used) because I think people using Material UI might be familiar with the term text field more than input components.

If you think, it's too ambiguous, feel free to change it.


{{"demo": "FieldDemo.js"}}

Expand All @@ -58,4 +62,4 @@ This is ideal for touch devices and narrow ranges of values.

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

- [`<NumberField />`](https://base-ui.com/react/components/number-field#api-reference)
- [`NumberField`](https://base-ui.com/react/components/number-field#api-reference)
Loading