ngx-prompt-kit

Approval

ngx-prompt-kit original — not part of ibelick/prompt-kit

A confirmation card for tool execution. Three severity tiers (info / warning / destructive) drive the action badge color and the Approve button variant. Built on spartan's card, badge and button; the pending state shows an hlm-spinner.

Examples

Minimal — yes / no question

Just a title and the two buttons. Use when there's nothing to disclose beyond the question itself — tool name, parameters, and severity all elided.

Allow the assistant to access your clipboard?

Info — read-only tool call

Default severity. Use for low-risk actions: querying data, reading a file, listing resources. Approve gets the default button styling.

Run database query

The assistant wants to read from the analytics warehouse. No mutation will occur.

execute
tableevents_2026_05limit10000

Warning — side effects

Use for actions with reversible-but-noisy side effects: sending notifications, creating records, calling rate-limited APIs.

Send email to 247 recipients

The assistant prepared a marketing campaign. Recipients are filtered to verified addresses only.

send
listq2-newsletterrecipients247 (verified only)subjectYour Q2 update is here — three new releases inside

Destructive — irreversible

Use for hard-to-reverse actions. The Approve button switches to destructive variant. Pending state shows a spinner and disables both buttons.

Delete repository

Removes the repository, all branches, and all associated CI history. This cannot be undone.

delete
orgPianoNicrepongx-prompt-kitbranches14workflow runs1,243

Installation

Add the approval component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:approval

It is built on spartan/ui, so add these helm components too: badge, button, card, spinner.

ng g @spartan-ng/cli:ui badge button card spinner

Component API

PkApproval

PropTypeDefaultDescription
titlestring — The action being requested (required).
descriptionstring | undefined — Optional context shown beneath the title.
actionstring | undefined — Verb shown in the badge — e.g. "execute", "send", "delete".
severity"info" | "warning" | "destructive" "info" Drives the action badge tint and the Approve button variant.
parametersreadonly ApprovalParameter[] [] Label/value rows shown beneath the description. Each: { label, value, truncate? }.
approveLabelstring "Approve" Approve button label.
rejectLabelstring "Reject" Reject button label.
pendingboolean false Disables both buttons and shows a spinner on Approve while an async action is in flight.
classstring — Extra classes for the host.

PkApprovalParameter

PropTypeDefaultDescription
labelstring — Parameter name (required).
valuestring — Parameter value, rendered in monospace (required).
truncateboolean true Truncate long values with ellipsis.

Outputs

PropTypeDefaultDescription
approved() => void — Approve clicked, or Enter pressed while focused.
rejected() => void — Reject clicked, or Esc pressed while focused.