Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProShows how a generated form receives errors from an API: the handler returns field errors that appear on the right inputs and clear when the person edits, and a thrown error becomes a form-level message. Use this when validation that only the server can do (uniqueness, permissions) must show up in a generated form.
This item has no props to tune. Use the lens above to change theme, density, direction and more.
A generated form posts to an API that can reject specific fields or the whole request.
Do not use it when: If the server errors have no field paths, show a banner instead of forcing them onto fields.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Description |
|---|---|---|
create | (values) => Promise<{ ok, errors? }> | Your API call. errors maps field paths to a message. |
aria-invalid, exactly like a client error, so the experience does not change depending on who found the problem.The pattern ships with a Testing Library test (auto-form-server-errors.test.tsx) that covers: its main behaviour, the keyboard path and the error or empty states.