Form fields·loomora/NumberField

NumberField

A TextField wrapper that formats typed numbers and reports a numeric value (number or undefined) on change events.

Interactive live playground

Tweak props, change states, and see the live component respond in real time.

Live

How to call

Import directly from the Loomora package root. For projects without Tailwind CSS, ensure loomora/dist/index.css is imported once in your root layout.

import { NumberField } from 'loomora'

<NumberField label="Price" decimalsMax={2} properties={{ value, onChange: (e) => setValue(e.target.value) }} />

API reference

Important public props and how they affect rendering.

6 props
PropTypeDefaultDescription
properties.valuenumber | null—Controlled numeric value.
properties.onChange(e) => void—Event whose target.value is a number or undefined.
decimalsMin / decimalsMaxnumber0 / 3Fraction digits.
thousandSeparatorstring','Group separator.
decimalSeparatorstring'.'Decimal separator.
allowNegativebooleanfalsePermits a leading minus.