Unsaved Changes
- from @sureui
useUnsavedChanges asks before unsaved changes are lost: the browser's prompt on reload or close, an awaitable confirmLeave() for leaving a page, and Keep editing, Discard changes and an optional Save in a Dialog, Sheet or Drawer's footer before it closes.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @sureui/unsaved-changesComponent source
No live preview has been built for this component yet.
Registry dependencies5
- alert-dialog
- button
- checkbox
- input
- label
Packages0
No npm packages are installed with it.
