Field meta
Field meta describes how a field has been interacted with, not whether its value is valid.
Formora intentionally separates interaction state from validation so that UI behavior remains predictable and under your control.
What is field meta?
Field meta answers questions like:
- Has the user interacted with this field?
- Has its value changed from the initial value?
It does not answer:
- Is the value correct?
- Should an error be shown?
Those decisions belong to validation and UI logic, not meta state.
Available meta state
Formora exposes two pieces of field meta:
toucheddirty
Both follow the same nested shape as values and errors.
touched
touched becomes true when a field loses focus (blur).
This means:
- the user has interacted with the field
- the field was focused at least once
<input {...form.register("email")} />;
{
form.touched?.email && <span>Field was touched</span>;
}
A touched field is not necessarily invalid.
dirty
dirty indicates whether the current value differs from initialValues.
Important characteristics:
- value-based comparison (not event-based)
- works with nested paths (
profile.email) - works with arrays (
items.0.name)
<input {...form.register("email")} />;
{
form.dirty?.email && <span>Value was modified</span>;
}
Error visibility vs validation
Formora separates responsibilities:
| Concern | Controlled by |
|---|---|
| What is invalid | validation rules (required, validate, etc.) |
| When to show error | your UI logic |
Formora exposes:
errors— what is invalidtouched/dirty— how the user interacted
You decide when errors are visible.
Common patterns
Show errors after blur (recommended for blur mode)
<input {...form.register("email", { required: "Email is required" })} />;
{
form.touched?.email && form.errors?.email && (
<p>{String(form.errors.email)}</p>
);
}
Show errors immediately (live feedback)
{
form.errors?.email && <p>{String(form.errors.email)}</p>;
}
What Formora does NOT track
To keep behavior predictable, Formora does not track:
- async validation state
- per-field loading state
- automatic error visibility rules
These are application-level concerns.
Summary
touchedtells you if a field was interacted withdirtytells you if a value changed from its initial value- Meta state does not imply validity
- You control when and how errors are shown
This explicit separation avoids hidden UX rules and makes complex forms easier to reason about.