When clicking the save buttons in the Edit view, and it takes a while, we get a nice modal / overlay ("Loading..") until the process completes.
I'm building my custom component that includes a button, and on click may trigger a long running operation.
How can I reuse the Payload loading component, so that we maintain UX consistency ?
Hey! We do not export the loader via a "clean" path, but we could. In the meantime you can import the
LoadingOverlayToggle
from
payload/dist/admin/components/elements/Loading
You can see how we use that component here:
https://github.com/payloadcms/payload/blob/master/src/admin/components/views/Account/Default.tsx#L76-L80Star
Discord
online
Get help straight from the Payload team with an Enterprise License.