Skip to Content

Feedback Components

Present notifications, confirmation dialogs, and recovery actions with Puzzle Pieces.

Feedback compositions provide presentation primitives and callbacks; applications remain responsible for notification delivery and action outcomes.

Beta API maturity: Beta. These compositions are new and may evolve based on feedback.

Installation

import {
  ConfirmAction,
  ErrorStatePanel,
  NotificationItem,
  NotificationList,
} from "@puzzle-ui/pieces";

Notifications

Use NotificationList for an empty state and a collection of items. NotificationItem can be used separately inside a list when custom collection rendering is needed.

390 × 844

Confirming an action

ConfirmAction uses Puzzle's Dialog and Button components. The callback runs only after explicit confirmation; application code owns errors and persistence.

<ConfirmAction
  triggerLabel="Delete project"
  title="Delete this project?"
  description="This action cannot be undone."
  confirmLabel="Delete"
  onConfirm={deleteProject}
/>
390 × 844

Error recovery

ErrorStatePanel composes Puzzle's error Alert with an optional recovery action.

390 × 844

Accessibility and responsive behavior

  • Notification collections use list semantics and timestamps can include machine-readable dateTime values.
  • Dismiss buttons have accessible names.
  • Confirmation uses the Puzzle Dialog's labelled modal and keyboard dismissal behavior.
  • Error messages use the Puzzle Alert's assertive semantics.
  • Provide concise labels and avoid relying on color alone to communicate status.

API

ComponentProps
NotificationItemtitle (required), description, timestamp, dateTime, href, unread, onDismiss, dismissLabel, className
NotificationListitems (required; each has id and NotificationItem props), label, emptyState, className
ConfirmActiontriggerLabel, title, confirmLabel, onConfirm (required), description, cancelLabel, confirmVariant, className
ErrorStatePaneltitle (required), description, action, className