# NumberFieldProps (@salmonui/inputs/number-field)

> The NumberFieldProps interface of @salmonui/inputs/number-field.

Canonical: https://salmonui.dev/docs/reference/inputs/number-field/NumberFieldProps

```ts
import type { NumberFieldProps } from '@salmonui/inputs/number-field';
```

Entry index: https://salmonui.dev/docs/reference/inputs/number-field (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/number-field.md).

## Reference

Kind: interface

```ts
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;
}
```

Members (30):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `label` | `label?: ReactNode;` | optional, inherited |  |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) \| ReactNode;` | optional, inherited | Error text (or a function of the errors) shown while the field is invalid. |
| `invalid` | `invalid?: boolean;` | optional, inherited | Forces the error state. |
| `validation` | `validation?: FieldValidation;` | optional, inherited | Rules in the Data Grid vocabulary. |
| `validateOn` | `validateOn?: ValidateOn;` | optional, inherited | When errors appear; default the `Form`'s, else `'blur'`. |
| `size` | `size?: FieldSize;` | optional, inherited | Metric set. Default `'md'`. |
| `value` | `readonly value?: number \| null \| undefined;` | optional |  |
| `defaultValue` | `readonly defaultValue?: number \| null \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: number \| null, details: NumberChangeDetails) => void) \| undefined;` | optional |  |
| `min` | `readonly min?: number \| undefined;` | optional |  |
| `max` | `readonly max?: number \| undefined;` | optional |  |
| `step` | `readonly step?: number \| undefined;` | optional | Arrow keys and the stepper change the value by `step`; Page keys by ten steps. Default 1. |
| `showStepper` | `readonly showStepper?: boolean \| undefined;` | optional | Increment and decrement buttons. Default true. |
| `formatOptions` | `readonly formatOptions?: Intl.NumberFormatOptions \| undefined;` | optional | `Intl.NumberFormat` options of the blurred text. |
| `format` | `readonly format?: string \| undefined;` | optional | A Data Grid `column.format` preset or pattern instead (`'n2'`, `'C2'`, `'P1'`, `'#,##0.00'`). |
| `currency` | `readonly currency?: string \| undefined;` | optional | ISO 4217 code for currency formats. |
| `locale` | `readonly locale?: string \| undefined;` | optional | BCP 47 locale for formatting and parsing. Default `'en-US'`; the host locale is never read. |
| `decimals` | `readonly decimals?: number \| undefined;` | optional | Fraction digits the committed value is rounded to. |
| `restrictDecimals` | `readonly restrictDecimals?: boolean \| undefined;` | optional | Refuses typing more fraction digits than `decimals`. |
| `clampBehavior` | `readonly clampBehavior?: 'blur' \| 'none' \| undefined;` | optional | `'blur'` (default) clamps to `min` / `max` on blur; `'none'` keeps the value and reports the range error. |
| `incrementOnWheel` | `readonly incrementOnWheel?: boolean \| undefined;` | optional | Mouse wheel over the focused field steps the value. Default false. |
| `clearable` | `readonly clearable?: boolean \| undefined;` | optional |  |
| `startAdornment` | `readonly startAdornment?: ReactNode;` | optional |  |
| `endAdornment` | `readonly endAdornment?: ReactNode;` | optional |  |
| `localeText` | `readonly localeText?: NumberFieldLocaleText \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: {     readonly group?: string;     readonly input?: string;     readonly label?: string;     readonly description?: string;     readonly error?: string;     readonly stepper?: string; } \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<HTMLInputElement> \| undefined;` | optional | The native `<input>`. |
