Forms

Field

Label, control, and error or hint in one column. It wires the control for screen readers: id, aria-describedby and aria-invalid.

view .md
Preview
we never share it
Tell me a bit more.
Installation
terminal
bash
npx @entrepta/cli@latest add field

// Resolves dependencies, copies the source, and installs npm packages automatically.

Usage
field.tsx
tsx
import { Field } from "@/components/entrepta/field"
import { Input } from "@/components/entrepta/input"
import { Textarea } from "@/components/entrepta/textarea"

<Field id="email" label="email" required hint="we never share it">
  <Input type="email" required />
</Field>

<Field id="message" label="message" error={errors.message}>
  <Textarea />
</Field>
Props
PropTypeDefaultDescription
idstring-The control's id. Error and hint ids derive from it
labelReactNode-Mono label with a ◆
iconIcon | ReactElement-A Phosphor icon, or an icon element, in place of the label's ◆
requiredboolean-Adds a brand *. Put required on the control too
errorReactNode-Replaces the hint, announced as an alert
hintReactNode-Muted line under the control
Active theme: entrepta, dark mode.