---
title: "text-input"
image: "https://adonia.pages.dev/og.png"
version: "next"
---

> Documentation Index
> Fetch the complete documentation index at: https://adonia.pages.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# text-input

<!-- Generated by `pnpm docs:fields` from packages/core/src/schema/fields/text.ts. Edit the TSDoc, not this file. -->

Single-line text input bound to a string attribute.

| | |
| --- | --- |
| Builder | `F.text(attribute: string): TextInput` |
| Wire type key | `text-input` |
| Class chain | `TextInput` → `TextualField` → `Field` |
| Detail projection | `text-entry` |
| Column counterpart | `text` cell, i.e. `C.text(attribute)` |

## Example

```ts
import { F } from '@adonia/core'

F.text('title').label('Title').required().maxLength(140).live()
```

## Props

Beyond the shared [field DSL](/reference/fields#the-shared-field-dsl):

| Prop | Declared on | Behaviour |
| --- | --- | --- |
| `datalist(values: readonly string[]): this` | `TextInput` | Native autocomplete suggestions (§7.3 `datalist`). Suggestions only — the value is NOT constrained to the list; use `F.select` for a closed set, which is also the only form §11.1 can enforce as an enum. |
| `mask(pattern: string): this` | `TextualField` | Input mask as a REGEX SOURCE string (`'^[A-Z]{2}-\\d{4}$'`), not a `RegExp`: props ride the wire verbatim and must survive `JSON.stringify` (protocol §2 rule 1). The client uses it to constrain typing; §11.1 compiles the same source into `regex(mask)` so a client bypass cannot smuggle an unmasked value past the validator. |

## Validation

Vine base: `vine.string()`.

§11.1 mapping: `vine.string().trim()` plus the declared length and mask
modifiers, read off `this.props` so a `withProps` override behaves
identically to the typed DSL.

Contributed by `TextualField.vineSchema()` in `packages/core/src/schema/fields/textual.ts`. The shared modifiers (`required`, `nullable`, `requiredWhen`, `unique`, optionality) are applied on top by `Field.buildValidation`, and a `rules()` override replaces the base entirely — the validator compiler never branches on the field class.

## Declared in

- `packages/core/src/schema/fields/text.ts` — `TextInput`
- `packages/core/src/schema/fields/textual.ts` — `TextualField`

Source: https://adonia.pages.dev/reference/fields/text-input/index.mdx
