Skip to content

Internal ID software / Forms

QuantityStepper

A number chosen with minus and plus, around a real number field.

Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/quantity-stepper.tsx. From the old system: QuantityStepper in @id-identity-as/ui/buy.

Example

Sælges i kolli a 10. Mindst 10 stk.

Sælges i kolli a 10. Mindst 10 stk.

import { QuantityStepper } from '@/components/software/quantity-stepper';

<QuantityStepper label="Antal" name="quantity" min={10} step={10} defaultValue={20} helper="Sælges i kolli a 10." />

Props

PropTypeDefaultWhat it does
label (required)stringWhat is counted.
name (required)stringThe form field name. The value posts like any other field.
minnumber0The lowest number.
maxnumberThe highest number.
stepnumber1How much one press changes the number.
defaultValuenumberThe number from the start. Without it, min.
helperstringA line under the field.
onChange(value: number) => voidCalled with the new number.
labelsPartial<QuantityStepperLabels>{ decrease, increase }, read aloud for the two buttons. Danish by default.

Do

  • Use it for small counts that are nudged up and down.
  • Say the rule in the helper: the minimum, the pack size.

Do not

  • Do not use it for a number that is typed once, such as a year or a CVR number. That is Input.
  • Do not put it in the same row as the solid Button.

Accessibility

  • The field is a native number input with a real label, so 48 can be typed.
  • The two buttons are named by labels, and without script the field still works.

Tokens it uses

  • color.surface.base
  • color.text.default
  • color.neutral.500
  • color.software.muted
  • radius.sm
  • type.body.md
  • type.body.sm
  • type.heading.sm
  • space.inline.2
  • space.section.1
  • space.section.2