ErlangFormDocs v1.0.0
Basic fields

Text

Render a string input and configure labels and validation.

z.string() produces a text input and stores a string. Configure its label and placeholder through fieldConfig using the same key as the schema property.

Usage

Use your form instance from useForm. See the initial setup.

example.tsx
const schema = z.object({ username: z.string() });

<ErlForm
  form={form}
  schema={schema}
  fieldConfig={{
    username: { label: "Username", placeholder: "Enter username" },
  }}
/>

The example focuses on the string field and its configuration. For form initialization and submission, see the Quick Start.

See Field Config for all options and Field Section to group fields.

On this page