atomic-format-unit

This is for:

Developer
In this article

The atomic-format-unit component is used for formatting numbers with units. The numerical format of compatible parents will be set according to the properties of this component.

Properties

Property Attribute Description Type Default

unit (required)

unit

The unit to use in unit formatting. Leverages the Intl.NumberFormat constructor. The unit must be sanctioned unit identifier

string

unitDisplay

unit-display

The unit formatting style to use in unit formatting.

  • "long" (for example, 16 litres)

  • "short" (for example, 16 l)

  • "narrow" (for example, 16l)

"long" | "narrow" | "short" | undefined

'short'