A number field takes a figure, an amount of money or a percentage. It writes its separators as you type, shows its currency or its unit, and always submits the plain figure.
When the value is a quantity: something you add up, compare or charge. A value that’s only made of digits, like a code or a phone number, goes in a text field.
If you need
Use
Never
An exact amount of money: a budget, a price, a payment
Number field with a currency
A text field with the “$” typed by hand.
A percentage: a discount, a commission
Percentage number field
A slider, if the exact value matters.
A figure: pieces, hours, meters
Number field, with its unit if it has one (“h”, “m²”)
The browser’s number input.
A value within a range, in steps
Slider
A number field next to it.
A code, a phone number, a card
Text field, with its type
A number field: they aren’t quantities.
$USDdollars
From 1,000 to 50,000 dollars.
%percent
h
An amount with its range, a percentage and a figure with its unit, live: type and the separators appear on their own, without the cursor jumping.
$USDdollars
Do: The amount in the number field: the currency in view, separators on their own and the plain figure on submit.
Don’t: The amount in a text field, with the “$” and commas typed by hand: it’s submitted exactly as typed.
Do: The ZIP code in a text field, with the number pad: it keeps its zero, as written.
Don’t: The ZIP code in a number field: it isn’t a quantity, so it loses its zero and gains a comma.
Anatomy
It’s the text field with parts of its own: the label, the box, the help and the error are the same, and it adds the currency, the unit and what screen readers hear.
Part
What it is
The label
Its name, always on top and in view: “Budget”.
The box
The fields’ own: the fill, the radius and the rings.
The symbol
The currency before the figure, right next to it: “$” or “€”. Only without a picker, and in a currency that has one.
The figure
What you type, with its separators and in tabular figures: the commas don’t make the width dance.
The code or the “%”
After the figure, in secondary text: “USD”, “CAD” or “%”.
The unit
A figure’s unit, after it: “h”, “m²”. It’s seen and read.
The currency picker
With two currencies or more, at the end of the box: its code with its chevron. It takes the place of the symbol and the code.
The help and the error
The fields’ own: one line below, and the error in its place while it’s there.
A sibling of the text field
It isn’t a type of text field: it brings its own parts and behavior. What you see, “1,234.50”, isn’t what’s submitted, 1234.50.
Never the browser’s number input
It’s a text field that writes figures: that’s how it shows its separators, the cursor stays where you leave it and nothing is erased when the page paints it again.
Sizes
The fields’ three sizes, with the same type and the same radius. Each size goes with the button of its height.
Size
Height
Type
For
small
36
14; 16 by hand
A console’s bars and filters.
medium
44
16
A portal’s bars, filters and tables.
large
52
16
Forms: a budget, a payment, a new client.
small
Currency
medium
Currency
large
Currency
Small, medium and large, each with its currency picker.
The symbol, next to the figure
2 away from it, like the fields’ prefix: the amount reads as one.
The currency, at full height
By hand, the picker is touched across the field’s full height: 44 in medium and 52 in large.
The width of its column
An amount is as wide as the column that holds it, with no maximum of its own. In a row of two fields, the page’s grid decides.
States
The fields’ own, on the control: focused, with an error, disabled and read-only.
$USDdollars
Enter an amount from 1,000 to 50,000 dollars.
$USDdollars
$USDdollars
Outside its range, with its message in words; disabled; and read-only, with its currency next to the figure.
State
How it looks
At rest
The figure in primary text; the symbol, the code and the example in secondary text.
Hover
Only with a fine pointer: the fill goes up one step.
Focus
The 2 px ring, 2 away, and the caret in the accent. The currency picker has its own focus, inside the box.
With an error
The 1.5 ring inside and the message with its icon in place of the help. It appears when you leave, if you typed, and on submit; it clears as soon as the figure is valid.
Disabled
Everything in the disabled tone, without opacity. It isn’t submitted.
Read-only
No box and no picker: the figure as text, with its unit next to it, a word space apart (“$4,500 USD”, “24 h”). It can be selected, copied and submitted.
Forced colors
The fields’ box and ring; the currency’s chevron in CanvasText and its focus in Highlight.
The currency and its picker
The currency shows next to the figure and is said in words. When people choose it, it goes in a picker inside the same field.
$USDdollars
Currency
An amount with its symbol and its code, and a price with its picker, live: open the list with the mouse or with Enter, and the amount changes currency.
Without a picker, the symbol and the code
The “$” before the figure and “USD” after it. A currency without a symbol shows only its code: “1,234.50 CAD”.
With a picker, only the code
Two currencies or more are chosen at the end of the box, with their code and their chevron, without a symbol: MXN and USD share the “$”.
The list says its name
Open, each currency shows its name and its code: “US dollar”, USD. MXN, USD and EUR have a name; the rest go by their code, just once.
It’s submitted apart
The figure and the currency are two values: budget=1234.50 and budget-currency=USD. Pasting “USD 10” doesn’t change the chosen currency.
Changing it changes everything
With another currency, screen readers hear the amount in it, and a message already in view is said in the new one: “from 0 to 100,000 euros”.
Formatting as you type
The figure is written with its separators as you type, the cursor stays where it was and what doesn’t go in is said.
Separators appear on their own
The language’s own, without the cursor jumping: typing inside “1,|234” leaves “19,|234”. Deleting a comma deletes the digit beside it.
A typed comma is the decimal point
In a field with decimals and no point yet, “12,5” is 12.5, never 125: that’s how the decimal key of a phone set to a comma region writes decimals. The thousands comma is never typed, because it appears on its own.
What you paste is cleaned
“$1,234.50”, “1,234.50 USD” and “1.234,50” give “1,234.50”: with both separators, the last one is the decimal. The same with what you drag, autofill, autocorrect and dictation. Without digits, nothing goes in.
What doesn’t fit doesn’t go in
A letter, a second point, one decimal too many or a point inside a figure that would leave too many decimals stay out, and screen readers hear why, once: “Digits only.”, “Up to 2 decimals.”.
Undo, step by step
⌘Z or Ctrl+Z undoes, and ⌘⇧Z or Ctrl+Y redo, from the menu or by voice too. Keys in a row are one step; a paste and autofill, one each.
Dictation and composing keyboards
While composing, the figure stays as it goes; on confirming, it’s formatted and validated, without waiting for another key. Full-width digits (“1234”) are digits too.
On leaving, the cents
An amount completes its decimals if it has any (“1,234.5” becomes “1,234.50”); a whole number stays whole.
Negatives, if the range allows them
With a negative minimum, a “-” anywhere flips the sign and another removes it. It shows with the typographic minus, “−1,234.50”, and is submitted as -1234.50. Without a negative minimum, the “-” doesn’t go in.
Content
The label names the quantity; the field says its unit, its decimals and its range.
Part
How it’s written
Example
The label
What’s asked for, without the unit or the symbol: the field already shows them.
“Budget”, not “Budget ($)”
The unit
A figure’s unit, short and after it. The currency and the percentage already say theirs.
“h”, “m²”
The decimals
None in a figure, two in a currency and one in a percentage, unless the value asks for others.
“1,500”, “1,234.50”, “12.5%”
The percentage
The number you type, never its fraction: it’s submitted as typed.
“12.5”
The example
A real figure with its format, never the instruction.
“25,000”
The help
The range, if it’s needed before typing.
“From 1,000 to 50,000 dollars.”
When
Message
Missing: a figure, an amount or a percentage
“Enter a number.” · “Enter an amount.” · “Enter a percentage.”
Outside the range
“Enter an amount from 1,000 to 50,000 dollars.”
Only a minimum · only a maximum
“Enter 1,000 dollars or more.” · “Enter 100% or less.”
A figure with its unit
“Enter a number from 1 to 168 h.”
Not a figure
“Use digits only (1,500.50).”
The currency, in words
The message says the field’s currency the way screen readers hear it (“pesos”, “dollars”, “euros”), never the “$”, which with pesos would be read as “dollar”.
The range, with the field’s figures
Its figures carry the language’s separators, and the percentage, its sign. With help that already states the range, the error repeats it.
A message of its own, if the page knows more
messages changes the missing one and the range one, as in the other fields.
Languages and direction
The language’s figures
Separators come from the page’s format: a thousands comma and a decimal point in en-US and in es-MX. The percentage does change: “12.5%” and «12.5 %».
Its text, in both languages
The picker’s name, each currency’s name, “percent” and every message come with lang: “Currency” and «Moneda», “Enter an amount.” and «Escribe una cantidad.».
The currency, in the page’s language
“pesos”, “dollars” and “euros”; in Spanish, «pesos», «dólares» and «euros». One without a name goes by its code.
Right to left
The figure is still written left to right, with its sign before the first digit, and it aligns to the side where the line starts.
Accessibility
A text field with its label, the amount in words and what doesn’t go in, said. It meets WCAG 2.2 AA.
Key
What it does
Tab
From the figure to the currency, and from there to the next field
Enter · Space
On the currency, opens the list
↑ ↓
In the list, moves through the currencies. On the figure they don’t change it: it’s a text field
Escape
Closes the list without changing the currency
⌘Z · Ctrl+Z
Undoes the last step
⌘⇧Z · Ctrl+Y
Redoes it
The whole amount
Screen readers hear the figure and then the amount with its currency in words: “1,234.50, 1,234.50 dollars”. The symbol and the code on screen aren’t read, so they aren’t heard twice.
What doesn’t go in is said
Through the page’s live region, once per reason: someone who can’t see the screen knows why a key wrote nothing.
The picker has a name
Its name joins “Currency” and the field’s label: “Currency Price”. By hand, “Next” goes from the figure to the currency.
Without JavaScript, the rule in words
The field asks for the plain figure and the browser’s message says how: “Digits only, no commas or symbols (1234.50).”. The server checks the range.
Autofill for a purchase
With transaction-amount on the figure, the currency carries transaction-currency.
Measured contrast
The figure, 8.6:1; the symbol and the code, 4.6:1; the currency’s focus, 3.6:1. They’re the fields’ worst cases on every layer.
Motion and sound
Piece
What it does
Spring
With reduced motion
The box
The fill and the ring change with focus
drop
Fades in 200 ms
The error
Comes in with its icon
bloom
Fades in 200 ms
The currency list
Opens next to the field
drop
Fades in 200 ms
Typing never sounds
The form sounds: send on submit and error if validation stops it. What doesn’t go in is said through the live region, without sound.
New guide: when to use it instead of a text field, the currency and its picker, formatting as you type and how its units, decimals and range are written, with live pieces. Text fields asks for it for an amount, and its suffix stays next to its value when read-only; Slider, for an exact value.
Figma is a trademark of its owner; its logo appears only to show compatibility and does not imply endorsement.
We use cookies to measure and improve the site. Learn more