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.