Skip to main content
Refine AI
Version: 4.xx.xx
Source Code

<AutoSaveIndicator />

<AutoSaveIndicator> component from Refine for Ant Design can be used to communicate auto-save status to the user.

Good to know:

This component is an extended version of the <AutoSaveIndicator> component from Refine's core package. It provides a set of elements which align with Ant Design's components and styling.

Usage

import { AutoSaveIndicator, useForm } from "@refinedev/antd";

const MyComponent = () => {
const { autoSaveProps } = useForm({
refineCoreProps: {
autoSave: {
enabled: true,
},
},
});

console.log(autoSaveProps);
/*
{
status: "success", // "loading" | "error" | "idle" | "success"
error: null, // HttpError | null
data: { ... }, // UpdateResponse | undefined,
}
*/

return <AutoSaveIndicator {...autoSaveProps} />;
};

API Reference

Properties

PropertyTypeDescription
data

UpdateResponse<BaseRecord>

The data returned by the update request.

error

HttpError | null

The error returned by the update request.

status

"loading" | "success" | "error" | "idle"

The status of the update request.

elements

Partial<Record<"loading"

"success"

"error"

"idle", ReactNode>>

The elements to display for each status.