Checkpoint
A simple component for marking conversation history points and restoring the chat to a previous state.
What is React?
React is a JavaScript library for building user interfaces. It was developed by Facebook and is now maintained by Meta and a community of developers.
How does component state work?
Installation
Copy
If you prefer using jsrepo, please install via the command below:
Copy
Usage
Copy
Examples
With Tooltip
Copy
With Conversation
Copy
Custom Icon
Copy
Component API
Checkpoint
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | - | Additional CSS classes to apply to the container |
children | Snippet | - | Child components (CheckpointIcon, CheckpointTrigger) |
...restProps | HTMLAttributes<HTMLDivElement> | - | All other div props are supported |
CheckpointIcon
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | - | Additional CSS classes to apply to the icon |
children | Snippet | - | Custom icon content (overrides default icon) |
size | number | 16 | Size of the icon in pixels |
CheckpointTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
class | string | - | Additional CSS classes to apply to the button |
children | Snippet | - | Button content |
variant | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' | 'ghost' | Button variant style |
size | 'default' | 'sm' | 'lg' | 'icon' | 'sm' | Button size |
tooltip | string | - | Optional tooltip text to display on hover |
onclick | (e: MouseEvent) => void | - | Click handler function |
disabled | boolean | false | Whether the button is disabled |
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)
- Optional tooltip for additional context
- Keyboard accessible with proper ARIA labels
- Responsive design that adapts to different screen sizes
- Seamless light/dark theme integration
Use Cases
- Conversation branching and exploration
- Undo functionality for chat history
- Version control for conversations
- Debugging conversation flows
- Enhanced user control over chat history