# TextFieldProps (@salmonui/inputs/text-field)

> The TextFieldProps interface of @salmonui/inputs/text-field.

Canonical: https://salmonui.dev/docs/reference/inputs/text-field/TextFieldProps

```ts
import type { TextFieldProps } from '@salmonui/inputs/text-field';
```

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

## Reference

Kind: interface

```ts
interface TextFieldProps extends TextBaseProps, NativeInput {
    readonly type?: 'text' | 'password' | 'email' | 'tel' | 'url' | 'search' | undefined;
    readonly ref?: Ref<HTMLInputElement> | undefined;
}
```

Members (19):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type?: 'text' \| 'password' \| 'email' \| 'tel' \| 'url' \| 'search' \| undefined;` | optional | Input type; numbers use `NumberField`. Default `'text'`. |
| `ref` | `readonly ref?: Ref<HTMLInputElement> \| undefined;` | optional | The native `<input>`. |
| `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` | `value?: string;` | optional, inherited |  |
| `defaultValue` | `defaultValue?: string;` | optional, inherited |  |
| `onValueChange` | `onValueChange?: ((value: string, details: TextChangeDetails) => void);` | optional, inherited |  |
| `clearable` | `clearable?: boolean;` | optional, inherited | Shows a clear button while there is a value; Escape clears too. |
| `startAdornment` | `startAdornment?: ReactNode;` | optional, inherited |  |
| `endAdornment` | `endAdornment?: ReactNode;` | optional, inherited |  |
| `localeText` | `localeText?: TextFieldLocaleText;` | optional, inherited |  |
| `className` | `className?: string;` | optional, inherited | Root class and style (the input gets every other prop). |
| `style` | `style?: CSSProperties;` | optional, inherited |  |
| `classNames` | `classNames?: { readonly group?: string; readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; };` | optional, inherited | Part classes: `root` is `className`; `group`, `input`, `label`, `description`, `error`. |
