Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
Number field
A number typed or stepped: a depth, a count, a threshold. An Input with − and + and a unit.
Fields
0 to 500 m, in half metres.
<Field label="Sampling depth">
<NumberField bind:value={depth} min={0} max={500} step={0.5} suffix="m" />
</Field> Fine steps
Give fineStep for a second, smaller step: with Option (Alt) held, − and + and the arrow keys use it. Here 0,5 m, or 0,1 m with Option.
Sizes
Rules
- For a number someone knows. To feel out a value, use a Slider.
- The unit goes in `suffix`, not the label: "Depth" with "m" after the value.
- Set `min` and `max` when there are limits; the value is held to them when the field is left.
- The step sets the decimals: 0.5 keeps one, 1 keeps none.
- A comma works as a decimal point, as people type it here.