Rebar UI

1.0

opinion

VersionHistory

A drawer of saved snapshots with a confirm-before-restore button on each row.

Brief historyOpen the drawer, restore asks first
One version
Long preview
Right side

In context

Document headerHistory sits next to the doc it belongs to
On track
MCHarbour launch briefEdited by Maya, 24 Oct 09:12

Launch is 24 Oct at 09:00. The crew briefing goes out two days before, and the livery photos are filed under Brand.

Props

PropTypeRequiredDefault
openboolean | undefinedNo—
defaultOpenboolean | undefinedNo—
onOpenChange((open: boolean) => void) | undefinedNo—
triggerReactNodeNo—
titleReactNodeNoVersion history
sideDrawerSide | undefinedNo—
sizenumber | undefinedNo—
classNamestring | undefinedNo—
versionsVersionSnapshot[]Yes—
currentVersionIdstring | undefinedNo—
onRestore(version: VersionSnapshot) => voidYes—
restoreConfirmMessage((version: VersionSnapshot) => string) | undefinedNo(version: VersionSnapshot) => `Restore "${version.label}"? This replaces the current content.`
bionicboolean | undefinedNo—
bionicOptionsBionicOptions | undefinedNo—

Restore

Built from the drawer chrome, a Popconfirm (it never restores on the first click) and a Tag for the current version.

data-rebar-* attributes

data-rebar-component="version-history"; rows carry data-rebar-part="row" | "label" | "timestamp" | "preview" | "restore-button".

Migrating to Ant Design

Not codemod-covered. Compose AntD's Drawer, List and Popconfirm; the shape maps across almost verbatim.