ValyroUI Русская версия

Form Autosave Status

Form autosave status: offline, error, version conflict and a useAutosave hook. Pro · Forms and input › Whole forms and filters

A quiet line that says where a form's autosave is: unsaved, saving, saved at a time, failed, waiting for the network, or in conflict with someone else's version — with the one action each state needs. Screen readers hear only the states that need attention, not every save.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add form-autosave-status
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { FormAutosaveStatus } from 'valyro-ui-pro';

Props

PropTypeDefault
status *'idle' | 'dirty' | 'saving' | 'saved' | 'error' | 'offline' | 'conflict'Where autosave is (from useAutosave().state.status or your own logic).
savedAtDateInputTime of the last successful save.
pendingnumber0Value changes not saved yet (from useAutosave, every keystroke counts): passed to the labels.
errorReactNodeWhy the last save failed.
onRetry() => voidAdds "Try again" to the error.
onSaveNow() => voidAdds "Save now" while there are unsaved edits.
onResolve(choice: 'mine' | 'theirs') => voidSettles a conflict: keep this version or take the server's.
onCompare() => voidAdds "Compare" to a conflict.
variant'inline' | 'badge''inline'inline (default): text and actions; badge: a compact pill, actions only on problems.
timeZonestringIANA time zone of the save time (default: the ThemeProvider's, then the reader's).
localestringBCP 47 locale for the time; defaults to the ThemeProvider's.
labelsPartial<FormAutosaveStatusLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Multi-step Form · Next: Filter Builder · All Forms and input