Checkpoint
A simple component for marking conversation history points and restoring the chat to a previous state.
The Checkpoint component provides a way to mark specific points in a conversation history and restore the chat to that state. Inspired by VSCode's Copilot checkpoint feature, it allows users to revert to an earlier conversation state while maintaining a clear visual separation between different conversation segments.
Install using CLI
Install Manually
Copy and paste the following code in the same folder.
Features
- Simple flex layout with icon, trigger, and separator
- Visual separator line for clear conversation breaks
- Clickable restore button for reverting to checkpoint
- Customizable icon (defaults to BookmarkIcon)
- Keyboard accessible with proper ARIA labels
- Responsive design that adapts to different screen sizes
- Seamless light/dark theme integration
Usage with AI SDK
Build a chat interface with conversation checkpoints that allow users to restore to previous states.
Add the following component to your frontend:
Use Cases
Manual Checkpoints
Allow users to manually create checkpoints at important conversation points:
Automatic Checkpoints
Create checkpoints automatically after significant conversation milestones:
Branching Conversations
Use checkpoints to enable conversation branching where users can explore different conversation paths:
Props
<Checkpoint />
''<CheckpointIcon />
''<CheckpointTrigger />
'''ghost''sm'