[material-ui][NumberField] Document format prop for units and currency - #49160
Open
Denimworld12 wants to merge 2 commits into
Open
Denimworld12 wants to merge 2 commits into
Denimworld12 wants to merge 2 commits into
Conversation
The Number Field page shows two variants that both spend the input's end adornment on the increment and decrement buttons, so there is no slot left for a unit or currency symbol. Readers reasonably try `startAdornment` / `endAdornment` as they would on TextField, and it does not work. `format` is the supported way to display one: it accepts `Intl.NumberFormatOptions` and is spread onto `NumberField.Root` by the demo wrapper, so it works with the components as documented. Base UI's API reference lists the prop but shows no currency or unit example, which is likely why this was not obvious. Adds a short section with prose and a one-line snippet. No new demo file, and decimal precision / `step` is left out as that is tracked in mui#47657. Closes mui#47666
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
siriwatknp
reviewed
Sep 18, 2026
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
siriwatknp
approved these changes
Sep 18, 2026
siriwatknp
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution! 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47666.
Summary
Both variants on the Number Field page spend the input's end adornment on the increment and decrement buttons, so there's no slot left for a unit or currency symbol. Someone coming from
TextFieldreasonably reaches forstartAdornment/endAdornmentand finds it doesn't work.formatis the supported way to show one — it acceptsIntl.NumberFormatOptions, and the demo wrapper spreads{...other}ontoNumberField.Root, so it works with the components exactly as documented on this page. Base UI's API reference lists the prop but includes no currency or unit example, which is probably why this wasn't obvious.This adds a short Units and currency section: two sentences plus a one-line snippet, placed after the two field variants and before the API section.
Following up on @mj12albert's explanation in the issue — the framing here is theirs, I've just written it down. I picked this up per the contributing guide's take-over guidance after the previous claim went ~8 weeks without a PR, and said so on the issue first.
Notes on scope
{{"demo"}}entry with a paired.tsx/.js. Happy to convert it to a real demo if you'd prefer.stepleft out deliberately — that's [docs][number field] Number input field precision and decimal step #47657, and a maintainer has already said extensive examples aren't wanted there for now.prettier@3.9.6using the repo's docs config (printWidth: 85); the file is clean.