Restore a saved conversation
A saved point in the conversation.
A conversation marker with an async restore action, retry feedback, and stable cancellation.
A saved point in the conversation.
A saved point in the conversation.
npm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { Checkpoint } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/checkpoint.
npx @noorddev/vlak-cli add checkpoint
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/checkpoint.json
Installs the same source through the shadcn CLI.
import { Checkpoint } from "@noorddev/vlak-react";
export function SavedCheckpoint({ onRestore }: { onRestore: () => void | Promise<void> }) {
return <Checkpoint label="Before editing" onRestore={onRestore} />;
}See the integration example to compose these components with your application's model and data.
A restore marker. The application owns saved history and the async restore operation.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | ReactNode | ||
onRestore | () => void | Promise<void> | ||
restoreLabel | string | "Restore checkpoint" | |
disabled | boolean | ||
onError | (error: unknown) => void |
Also accepts Omit<HTMLAttributes<HTMLDivElement>, "onError">.
The ref reaches HTMLDivElement.
| Keys | Does |
|---|---|
| Tab | Moves through the supplied native controls in reading order |
| Enter, Space | Activates focused buttons and disclosure summaries |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<div class="rs-checkpoint"><span class="rs-checkpoint-line"></span><span>Before editing</span><button class="rs-btn-subtle" type="button">Restore checkpoint</button><span class="rs-checkpoint-line"></span></div>