Skip to content

Commit

Permalink
Small docs fixes and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Aug 17, 2023
1 parent a2ef8a6 commit 242ffcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions docs/data/base/components/number-input/number-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ The following demo shows how to create a number input component, apply some styl
The `min` and `max` props can be used to define a range of accepted values. You can pass only one of them to define an open-ended range.

```tsx
<NumberInput min={-10} max={10} />
<NumberInput min={-10} max={10} />

// Open-ended
<NumberInput min={0} />
// Open-ended
<NumberInput min={0} />
```

The `step` prop can be used to defined the granularity of the change in value when incrementing or decrementing. For example, if `min={0}` and `step={2}`, valid values for the component would be 0, 2, 4… since the value can only be changed in increments of 2.
Expand All @@ -63,6 +63,10 @@ The `step` prop can be used to defined the granularity of the change in value wh
<NumberInput min={0} step={2} />
```

:::warning
Support for decimal values or step sizes isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/material-ui/issues/38518) to see it arrive sooner!
:::

When the input field is in focus, you can enter values that fall outside the valid range. The value will be clamped based on `min`, `max` and `step` once the input field is blurred.

Holding down the <kbd>Shift</kbd> key when interacting with the stepper buttons applies a multipler (default 10x) to the value change of each step.
Expand Down
2 changes: 1 addition & 1 deletion docs/data/base/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const pages: readonly MuiPage[] = [
{ pathname: '/base-ui/react-button', title: 'Button' },
{ pathname: '/base-ui/react-checkbox', title: 'Checkbox', planned: true },
{ pathname: '/base-ui/react-input', title: 'Input' },
{ pathname: '/base-ui/react-number-input', title: 'Number Input' },
{ pathname: '/base-ui/react-number-input', title: 'Number Input', newFeature: true },
{ pathname: '/base-ui/react-radio-button', title: 'Radio Button', planned: true },
{ pathname: '/base-ui/react-rating', title: 'Rating', planned: true },
{ pathname: '/base-ui/react-select', title: 'Select' },
Expand Down

0 comments on commit 242ffcf

Please sign in to comment.