# FieldState (@salmonui/inputs/form)

> The FieldState interface of @salmonui/inputs/form.

Canonical: https://salmonui.dev/docs/reference/inputs/form/FieldState

```ts
import type { FieldState } from '@salmonui/inputs/form';
```

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

## Reference

Kind: interface

```ts
interface FieldState {
    readonly inputId: string;
    readonly labelId: string;
    readonly descriptionId: string;
    readonly errorId: string;
    readonly errors: readonly string[];
    readonly invalid: boolean;
    readonly validating: boolean;
    readonly hasDescription: boolean;
    readonly inputProps: {
        readonly id: string;
        readonly 'aria-describedby': string | undefined;
        readonly 'aria-invalid': true | undefined;
        readonly 'aria-errormessage': string | undefined;
    };
    readonly rootProps: {
        readonly 'data-invalid': '' | undefined;
        readonly 'data-disabled': '' | undefined;
        readonly 'data-validating': '' | undefined;
    };
    readonly onBlur: () => void;
    readonly validate: () => readonly string[] | Promise<readonly string[]>;
    readonly errorMessage: ReactNode | ((ctx: {
        readonly errors: readonly string[];
    }) => ReactNode) | undefined;
}
```

Members (13):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `inputId` | `readonly inputId: string;` |  |  |
| `labelId` | `readonly labelId: string;` |  |  |
| `descriptionId` | `readonly descriptionId: string;` |  |  |
| `errorId` | `readonly errorId: string;` |  |  |
| `errors` | `readonly errors: readonly string[];` |  | Errors currently shown (rules, native constraints, server). |
| `invalid` | `readonly invalid: boolean;` |  | True while an error is shown or `invalid` is set. |
| `validating` | `readonly validating: boolean;` |  |  |
| `hasDescription` | `readonly hasDescription: boolean;` |  |  |
| `inputProps` | `readonly inputProps: {     readonly id: string;     readonly 'aria-describedby': string \| undefined;     readonly 'aria-invalid': true \| undefined;     readonly 'aria-errormessage': string \| undefined; };` |  | ARIA wiring for the element that owns the value. |
| `rootProps` | `readonly rootProps: {     readonly 'data-invalid': '' \| undefined;     readonly 'data-disabled': '' \| undefined;     readonly 'data-validating': '' \| undefined; };` |  | `data-*` state hooks for the root. |
| `onBlur` | `readonly onBlur: () => void;` |  | Call from the control's blur handler. |
| `validate` | `readonly validate: () => readonly string[] \| Promise<readonly string[]>;` |  | Runs every rule now and reveals the result (e.g. on commit). |
| `errorMessage` | `readonly errorMessage: ReactNode \| ((ctx: {     readonly errors: readonly string[]; }) => ReactNode) \| undefined;` |  |  |
