All components (283)
Checkpoint
AI · Checkpoint
What it is and when to use it
A checkpoint in a conversation or a job: a line with its name and its time, and the way back to it.
When to use it
- Marking the state before a big change so you can go back (before migrating, before applying a batch).
labelis the name of the point,timestampwhen it was saved, andonRestoreadds the go-back button.
When not to
- Separating two days of a conversation: a date separator.
- A history with many versions:
History.
Keyboard: Tab goes to the restore button; Enter or Space presses it.
Accessibility: it is a group named after the point; the button says which one it goes back to ("Restore to Before migrating"), so two points in a row do not sound the same to the screen reader. The time goes in a <time>.
Fine-tuning: amset-checkpoint and the amset-checkpoint__* classes.
What it looks like
Before migrating the database12 messages · 3 files
<Checkpoint
label="Before migrating the database"
timestamp={new Date("2026-11-08T10:30:00")}
summary="12 messages · 3 files"
onRestore={() => volverAEstePunto()}
/>Props
Import it with import { Checkpoint } from '@amset/ui'. Required props are marked.
| Prop | Type | What it does |
|---|---|---|
labelrequired | string | What this point is called: "Before migrating the database". Required. |
className | string | Merged with the library classes; it does not replace them. |
onRestore | () => void | If given, the point has a button to go back to it. |
restoreLabel | string | The text of the button. "Restore" by default. |
summary | string | What has changed since this point: "12 messages · 3 files". It is what decides whether to restore. |
timestamp | string | number | Date | When it was saved: a date, a `Date.now()` timestamp or an ISO string. |
It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.
In the test bench
Every state and variant, to try one at a time, on its page at storybook.amsetui.com:
