Confirmation

Collects approval or rejection in a surface with a subtle 1px outline and 4px corners, with async recording, error recovery, and 44px actions.

Add a review note?

This example records your decision locally.

Awaiting your decision

Review before continuing

YouComplete
Prepare an action list for the project notes.
AssistantComplete

Start with the review flow, assign an owner, and link the supporting sources.

Add this draft to the notes?

Review the proposed action list before approving it.

Awaiting your decision

Local decision only · Approval does not write a file or execute a tool

Use it for

  • Reviewing a proposed action before the application proceeds.
  • Awaiting successful recording of approval or rejection, with a retry when its callback fails.

Avoid

  • Treating approval recorded as proof that the proposed action has executed.
  • Authorizing solely in the browser; application and server code must validate the requested action and its permissions.

React package

npm install @noorddev/vlak-react

Load the stylesheet once at your app root, then import the components you use.

import "@noorddev/vlak-react/css";
import { Confirmation } from "@noorddev/vlak-react";

Per-component imports are available at @noorddev/vlak-react/components/confirmation.

Copy the source

npx @noorddev/vlak-cli add confirmation

Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.

shadcn registry

npx shadcn add https://vlak.dev/r/confirmation.json

Installs the same source through the shadcn CLI.

import { Confirmation } from "@noorddev/vlak-react";

export function AppendixApproval({ recordApproval }: {
  recordApproval: (approved: boolean) => void | Promise<void>;
}) {
  return <Confirmation title="Include the appendix?" onConfirm={() => recordApproval(true)} onReject={() => recordApproval(false)}>
    Adds the supplied appendix to the proposed draft. Review it before continuing.
  </Confirmation>;
}

See the integration example to compose these components with your application's model and data.

Confirmation

Records a decision about an application-owned action without executing a tool.

PropTypeDefaultDescription
titlerequiredReactNodeNames the proposed action and the confirmation region.
statusConfirmationStatus
defaultStatusConfirmationStatus"pending"
onStatusChange(status: Decision) => void
onConfirmrequired() => void | Promise<void>Records approval. A rejection keeps the proposal pending and allows retry.
onReject() => void | Promise<void>
confirmLabelstring"Confirm"
rejectLabelstring"Reject"
disabledboolean

Also accepts Omit<HTMLAttributes<HTMLElement>, "title">.

The ref reaches HTMLElement.

KeysDoes
TabMoves between Confirm and Reject while a decision can be made.
Enter, SpaceActivates the focused decision or retry button without submitting an enclosing form.
  • A native section is named by the visible title. Children supply context for the proposed action.
  • Pending recording exposes aria-busy, disables both actions, and prevents duplicate callback submissions.
  • Only a successful callback records accepted or rejected status. A failed callback leaves the proposal pending, reports an alert, and offers Try again for that decision.
  • status and onStatusChange support application-controlled decisions; defaultStatus sets the uncontrolled initial decision. A changed controlled status invalidates an older pending callback result.
  • A successfully recorded controlled decision stays locked until status changes. Use a new React key for a new proposal; a pending prop alone cannot resubmit an acknowledged decision.
  • The status announces Approval recorded or Rejected. This component records a decision; application code owns tool execution. The ref reaches the section, and native attributes pass through.

The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.

npm install @noorddev/vlak
import "@noorddev/vlak/css";
<section class="rs-confirmation" aria-labelledby="approval-title"><p id="approval-title" class="rs-confirmation-title">Include the appendix?</p><div class="rs-confirmation-context">Adds the supplied appendix to the proposed draft.</div><div class="rs-confirmation-actions"><button class="rs-btn-primary rs-confirmation-action" type="button">Confirm</button><button class="rs-btn-ghost rs-confirmation-action" type="button">Reject</button></div><p class="rs-confirmation-status" role="status">Awaiting your decision</p></section>

Classes

.rs-confirmation.rs-confirmation-title.rs-confirmation-context.rs-confirmation-actions.rs-confirmation-action.rs-confirmation-status.rs-confirmation-error