Checkpoint
A horizontal conversation restore divider pairing scale-drawn Separator rules and a Kinetic Button trigger that swaps into Restored.
Synced spring token presets and cleaned up duplicate Customize controls.
Applied experimental grid padding override and renamed footer actions.
Customize
Installation
npx shadcn@latest add @kinetic/checkpointUsage
Combine Checkpoint and CheckpointTrigger between conversation turns to mark a restorable snapshot (with an optional CheckpointIcon slot when needed).
"use client";
import { useState } from "react";
import {
Checkpoint,
CheckpointTrigger,
} from "@/components/kinetic/ui/checkpoint";
export function TurnCheckpoint() {
const [restored, setRestored] = useState(false);
return (
<Checkpoint timestamp="10:42 AM" restored={restored}>
<CheckpointTrigger restored={restored} onRestoredChange={setRestored}>
Restore checkpoint
</CheckpointTrigger>
</Checkpoint>
);
}Restore trigger and divider lines
Two flanking Separator rules draw outward from the center content via scaleDraw, while CheckpointTrigger supports controlled or uncontrolled restored state and switches smoothly into restoredLabel using directionalSwap and a drawStroke checkmark.
import {
Checkpoint,
CheckpointTrigger,
} from "@/components/kinetic/ui/checkpoint";
interface TurnDividerProps {
readonly timestamp: string;
readonly restored: boolean;
readonly onRestore: () => void;
}
export function TurnDivider({ timestamp, restored, onRestore }: TurnDividerProps) {
return (
<Checkpoint timestamp={timestamp} restored={restored} drawOnView={false}>
<CheckpointTrigger
variant="secondary"
restored={restored}
confirmOnClick={false}
onClick={onRestore}
>
Roll back here
</CheckpointTrigger>
</Checkpoint>
);
}Motion preferences
Checkpoint uses speed={0.45} and blurPx={8} by default for rule scaleDraw, content directionalSwap, and checkmark drawStroke. Reduced motion displays rules, labels, and checkmarks immediately without blur or draw delays.
API Reference
Checkpoint
Conversation divider combining two scale-drawn Separator rules, directional content enter, and synchronized restored state.
| Prop | Type | Default | Description |
|---|---|---|---|
timestamp / restored / lineClassName | React.ReactNode / boolean / string | undefined / false / undefined | Turn timestamp, controlled restored styling across CheckpointIcon/CheckpointTrigger, and custom line class. |
drawOnView / once / play | boolean / boolean / boolean | true / true / undefined | Triggers flanking Separator scaleDraw on viewport intersection or explicit play flag. |
animated / speed / blurPx | boolean / number / number | true / 0.45 / 8 | Enables animations, scales timing across lines and trigger swaps, and sets blur radius (px). |
CheckpointIcon
Bookmark or flag icon indicator that transitions to emerald highlight when restored.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "bookmark" | "flag" | "bookmark" | Chooses default bookmark or flag outline icon. |
CheckpointTrigger
Kinetic Button trigger swapping cleanly via directionalSwap and drawing a checkmark via drawStroke when restored.
| Prop | Type | Default | Description |
|---|---|---|---|
restored / defaultRestored / onRestoredChange | boolean / boolean / (restored: boolean) => void | false | Controlled or initial restored confirmation state. |
restoredLabel / confirmOnClick | React.ReactNode / boolean | "Restored" / true | Post-restore label text and automatic confirmation toggle on click. |
variant / size | KineticButtonVariant / KineticButtonSize | "outline" / "xs" | Kinetic Button visual variant and size preset. |
animated / speed / blurPx | boolean / number / number | inherited | Optional overrides for swap blur, speed, and stroke draw activation. |