Skip to main content
PROYECTOVIVIANA

NumberField

The props declared for NumberField, generated from the types @proyecto-viviana/ui ships.

Import

import { NumberField } from "@proyecto-viviana/ui";

Props

Props for NumberField in @proyecto-viviana/ui
PropTypeDefaultDescription
size'S' | 'M' | 'L' | 'XL'—The size of the number field.
stylesStyleString—Spectrum-defined generated classes.
UNSAFE_classNamestring—Additional CSS class name. Use only as a last resort.
UNSAFE_styleJSX.CSSProperties—Additional inline styles. Use only as a last resort.
classstring—Backward-compatible class alias. Prefer UNSAFE_className for S2 parity.
labelnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Label text for the input.
descriptionnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Description text shown below the input.
errorMessagenumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Error message shown when invalid.
hideStepperfalse | true—Whether to hide the stepper buttons.
labelPosition'top' | 'side'—Position of the label relative to the input.
labelAlign'start' | 'end'—Text alignment for side labels.
necessityIndicator'label' | 'icon'—Whether required fields show an icon or text label.
prefixnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—An icon or text rendered before the input.
slotstring | false—A slot name for the component. HTML `slot` may be `false` to omit. solidaria-components
idstring—The ID of the number field. solidaria
onBlurJSX.EventHandler<HTMLInputElement, FocusEvent>—Handler for blur events. solidaria
onChange(value: number) => void—Handler called when the value changes. solidaria-components
onCopyJSX.EventHandler<HTMLInputElement, ClipboardEvent>—Handler for copy events. solidaria
onCutJSX.EventHandler<HTMLInputElement, ClipboardEvent>—Handler for cut events. solidaria
onFocusJSX.EventHandler<HTMLInputElement, FocusEvent>—Handler for focus events. solidaria
onKeyDownJSX.EventHandler<HTMLInputElement, KeyboardEvent>—Handler for key down events. solidaria
onKeyUpJSX.EventHandler<HTMLInputElement, KeyboardEvent>—Handler for key up events. solidaria
onPasteJSX.EventHandler<HTMLInputElement, ClipboardEvent>—Handler for paste events. solidaria
aria-describedbystring—The element ID that describes the number field. solidaria
aria-labelstring—An accessible label for the number field. solidaria
aria-labelledbystring—The element ID that labels the number field. solidaria
isDisabledfalse | true—Whether the number field is disabled. solidaria
autoFocusfalse | true—Whether to auto-focus the input. solidaria
formstring—The form element this input belongs to. solidaria
namestring—The name for the form input. solidaria
valuenumber—The current value (controlled). solidaria-components
stepnumber—The step value for increment/decrement. solidaria-components
onFocusChange(isFocused: boolean) => void—Handler called when focus state changes. solidaria
localestring—The locale for number formatting. solidaria-components
validationState'valid' | 'invalid'—Not yet documented solidaria
defaultValuenumber—The default value (uncontrolled). solidaria-components
minValuenumber—The minimum value. solidaria-components
maxValuenumber—The maximum value. solidaria-components
isReadOnlyfalse | true—Whether the number field is read-only. solidaria
isInvalidfalse | true—Whether the number field is invalid. solidaria
isRequiredfalse | true—Whether the number field is required. solidaria
validationBehavior'aria' | 'native'"native"`"native"` sets the `required` attribute and omits `aria-required`. `"aria"` does the reverse. RAC `useNumberField` default is native. solidaria
validate(value: number) => boolean | string | string[] | null | undefined—Custom validation function. solidaria
isWheelDisabledfalse | true—Whether to disable incrementing/decrementing from the mouse wheel. RAC `useNumberField` `isWheelDisabled`. solidaria
decrementAriaLabelstring—A custom aria-label for the decrement button. If not provided, the localized string "Decrease" is used. solidaria
incrementAriaLabelstring—A custom aria-label for the increment button. If not provided, the localized string "Increase" is used. solidaria
formatOptionsIntl.NumberFormatOptions—Number format options. solidaria-components
commitBehavior'validate' | 'snap'"snap"Controls blur commit: `'snap'` clamps to min/max/step, `'validate'` leaves the value and reports native range/step validity. solidaria

Declared in packages/viviana-ui/src/numberfield/index.tsx.

Props marked solidaria or solidaria-components come from the headless layer underneath and behave the same in both registers. Components that wrap a DOM element also accept that element's standard attributes, which are left out here on purpose — listing them would bury the props that are actually ours.