API reference: @salmonui/inputs/number-field
NumberFieldPropsinterface
import type { NumberFieldProps } from '@salmonui/inputs/number-field';interface NumberFieldProps extends FieldCommonProps, NativeInput {
readonly value?: number | null | undefined;
readonly defaultValue?: number | null | undefined;
readonly onValueChange?: ((value: number | null, details: NumberChangeDetails) => void) | undefined;
readonly min?: number | undefined;
readonly max?: number | undefined;
readonly step?: number | undefined;
readonly showStepper?: boolean | undefined;
readonly formatOptions?: Intl.NumberFormatOptions | undefined;
readonly format?: string | undefined;
readonly currency?: string | undefined;
readonly locale?: string | undefined;
readonly decimals?: number | undefined;
readonly restrictDecimals?: boolean | undefined;
readonly clampBehavior?: 'blur' | 'none' | undefined;
readonly incrementOnWheel?: boolean | undefined;
readonly clearable?: boolean | undefined;
readonly startAdornment?: ReactNode;
readonly endAdornment?: ReactNode;
readonly localeText?: NumberFieldLocaleText | undefined;
readonly className?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
readonly stepper?: string;
} | undefined;
readonly ref?: Ref<HTMLInputElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
labeloptionalinherited | label?: ReactNode; | |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode; | Error text (or a function of the errors) shown while the field is invalid. |
invalidoptionalinherited | invalid?: boolean; | Forces the error state. |
validationoptionalinherited | validation?: FieldValidation; | Rules in the Data Grid vocabulary. |
validateOnoptionalinherited | validateOn?: ValidateOn; | When errors appear; default the |
sizeoptionalinherited | size?: FieldSize; | Metric set. Default |
valueoptional | readonly value?: number | null | undefined; | |
defaultValueoptional | readonly defaultValue?: number | null | undefined; | |
onValueChangeoptional | readonly onValueChange?: ((value: number | null, details: NumberChangeDetails) => void) | undefined; | |
minoptional | readonly min?: number | undefined; | |
maxoptional | readonly max?: number | undefined; | |
stepoptional | readonly step?: number | undefined; | Arrow keys and the stepper change the value by |
showStepperoptional | readonly showStepper?: boolean | undefined; | Increment and decrement buttons. Default true. |
formatOptionsoptional | readonly formatOptions?: Intl.NumberFormatOptions | undefined; |
|
formatoptional | readonly format?: string | undefined; | A Data Grid |
currencyoptional | readonly currency?: string | undefined; | ISO 4217 code for currency formats. |
localeoptional | readonly locale?: string | undefined; | BCP 47 locale for formatting and parsing. Default |
decimalsoptional | readonly decimals?: number | undefined; | Fraction digits the committed value is rounded to. |
restrictDecimalsoptional | readonly restrictDecimals?: boolean | undefined; | Refuses typing more fraction digits than |
clampBehavioroptional | readonly clampBehavior?: 'blur' | 'none' | undefined; |
|
incrementOnWheeloptional | readonly incrementOnWheel?: boolean | undefined; | Mouse wheel over the focused field steps the value. Default false. |
clearableoptional | readonly clearable?: boolean | undefined; | |
startAdornmentoptional | readonly startAdornment?: ReactNode; | |
endAdornmentoptional | readonly endAdornment?: ReactNode; | |
localeTextoptional | readonly localeText?: NumberFieldLocaleText | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
classNamesoptional | readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
readonly stepper?: string;
} | undefined; | |
refoptional | readonly ref?: Ref<HTMLInputElement> | undefined; | The native |