honestui

Undoable Action

Dashboards

About

Make a change on screen at once, offer Undo during a countdown, and send the request only when it ends.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Undoable Action to your project and fits it to your theme.

Code

How Undoable Action is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"
import "honestui/theme.css";

import {
  UndoBar,
  type UndoableAction,
  type UndoableEntry,
} from "@/components/ui/honest-undoable-action"

const entries: UndoableEntry[] = [
  {
    id: "waiting",
    message: "Archived 3 conversations",
    phase: "waiting",
    duration: 6000,
    remaining: 4000,
    deadline: null,
  },
  {
    id: "committing",
    message: "Archived “Invoice #1042 is paid”",
    phase: "committing",
    duration: 6000,
    remaining: 0,
    deadline: null,
  },
  {
    id: "failed",
    message: "Archived “Offsite agenda”",
    phase: "failed",
    duration: 6000,
    remaining: 0,
    deadline: null,
    error: new Error("The server could not be reached."),
  },
]

const noop = () => {}

const still: UndoableAction = {
  entries,
  paused: true,
  lastEvent: null,
  run: () => "",
  undo: noop,
  retry: noop,
  dismiss: noop,
  setPaused: noop,
  flush: noop,
}

/** A still picture of the three states. The buttons here are not connected to anything. */
export default function UndoableActionStates() {
  return (
    <div data-theme="light" className="w-full max-w-lg min-w-0">
      <UndoBar action={still} labels={{ region: "Every undo state" }} />
    </div>
  )
}

Dependencies

More by honestui

View all
  • Chromatic Text Reveal

    Chromatic Text Reveal

    30
  • Schedule Builder

    Schedule Builder

  • Audit Log

    Audit Log

  • Secret Row

    Secret Row

  • OTP Field

    OTP Field

  • Audio Orb

    Audio Orb

  • AI Glow Border

    AI Glow Border

  • Metaballs

    Metaballs

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    700
  • Analytics Dashboard

    Analytics Dashboard

    72
  • Insights Dashboard

    Insights Dashboard

    40
  • Creator Dashboard

    Creator Dashboard

    212
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    363
  • serf dashboard

    serf dashboard

    140
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    58