Components / Text field

Forms

Text field

stable

Single-line input with label, description, validation and adornments.

since v1.02.3 kB gzip

Preview

Will deploy to aurora-docs.strata.app

Installation

npx @strata/cli add text-field

Usage

import { TextField } from "@/components/strata";

<TextField
  label="Project name"
  description="Lowercase, no spaces."
  validate={(v) => (/\s/.test(v) ? "No spaces allowed" : null)}
/>

Props

PropTypeDefault
label

Visible label.

ReactNode—
description

Helper text below the input.

ReactNode—
isRequired

Marks the field required and validates on submit.

booleanfalse
validate

Custom validation returning an error message.

(value: string) => string | null—
prefix

Icon or text before the input.

ReactNode—
isDisabled

Prevents interaction and dims the control.

booleanfalse

Accessibility

Was this page helpful?

Documented since v1.0 · components/text-field.mdx