save status.md
Save Status
An autosave pill for editors that says Editing, Saving or Saved, counts changes while offline, and syncs them when the connection comes back.
Installation
npx shadcn@latest add @kokonutui/save-status
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title? |
string |
"Launch notes" |
|
defaultText? |
string |
demo |
|
idleMs? |
number |
700 |
Pause after typing before a save starts, in ms. |
onSave? |
(text: string) => Promise<void> |
() => wait(650) |
Stand-in for your save call: resolve when the server has it. |
className? |
string |
Extra classes for the root element. |
Source
// TypeScript code provided in the original content
// React component implementation
const DEMO_TEXT = "Launch is Thursday at 10:00....";
// additional component logic and functions
SaveStatus Component
This component utilizes hooks for state management and handles synchronization of text input with server-side storage.