Skip to main content
Version: Next

NumberField API

import { NumberField } from '@editora/ui-react';

Props​

PropTypeDescription
allowWheelboolean
autoCompletestring
clampOnBlurboolean
decrementTriggerReact.ReactNode
defaultValuestring | numberStarting value of an uncontrolled field (written once, on mount).
descriptionstring
disabledboolean
errorstring
format'plain' | 'grouped'
incrementTriggerReact.ReactNode
inputModestringHints at the type of data that might be entered by the user while editing the element or its contents
invalidboolean
labelstring
localestring
maxstring | number
minstring | number
namestring
onInput(detail: { rawValue: string; value: number | null }) => voidEvery keystroke: the raw text and its parsed number (null while it is not a number yet, e.g. "1.").
onInvalidValue(reason: string) => void
onValueChange(detail: NumberFieldChangeDetail) => voidCommitted value (blur, Enter, steppers).
placeholderstring
precisionnumber
prefixReact.ReactNode
readOnlyboolean
requiredboolean
showSteppersboolean
stepstring | number
suffixReact.ReactNode
valuestring | numberWith onValueChange the field is controlled: a committed value the parent rejects is undone.

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-number-field>​

NumberField renders the ui-number-field custom element from @editora/ui-core, which can also be used without React.

Attributes: allow-wheel, aria-describedby, aria-description, aria-label, autocomplete, clamp-on-blur, data-error, description, disabled, format, inputmode, invalid, label, locale, max, min, name, placeholder, precision, readonly, required, show-steppers, size, step, value, variant

Events: input, invalid