Atlas Forms
Reset Action
The reset action restores all form fields to their original initialValues. Unlike cancel, the user stays on the form. Use reset for data-entry forms where users may want to start over without leaving the screen.
What Reset Does
Clicking the reset action calls formEngine.reset(), which:
- Sets all field values back to the
initialValuesobject (or empty if none were provided) - Clears all validation errors
- Resets dirty and touched state — the form is treated as freshly loaded
- Does NOT clear the
StorageManagerdraft (unlike cancel) - Does NOT navigate away — the user stays on the same form page
Schema Example
{
"type": "reset",
"label": "Start Over",
"variant": "secondary",
"icon": "rotate-left",
"order": 1,
"config": {
"showConfirmDialog": true,
"confirmMessage": "Reset all fields to their default values?"
}
}
Reset with initialValues
If you pass initialValues to FormRenderer, reset restores to those values — not to empty:
<FormRenderer
schema={formSchema}
initialValues={{
country: 'US',
currency: 'USD',
status: 'active'
}}
mode="edit"
onSubmit={handleSubmit}
/>
// After reset, country='US', currency='USD', status='active'
Use Cases
- Data entry grids — After entering a row, reset the add-row form to blank
- Search/filter forms — Clear all filter criteria with one click
- Configuration forms — Restore defaults without leaving the settings page
- Multi-step forms — Reset a single step without restarting the wizard
Confirm Before Reset
For forms with significant data, add a confirmation dialog to prevent accidental resets:
{
"type": "reset",
"label": "Reset to Defaults",
"config": {
"showConfirmDialog": true,
"confirmMessage": "This will clear all your changes. Are you sure?"
}
}
Reset vs Clear Draft
Reset does not clear the StorageManager draft. If you want users to be able to resume from a clean state after reset, call
storage.clearDraft(formId) after the reset completes. Wire this in a custom action if needed.