ngx-prompt-kit

Message Actions Bar

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

A row of icon-only buttons with tooltips, intended to sit beneath a settled message. Hover-or-focus revealed by default; switch to visible='always' for persistent toolbars. Default action sets exported as DEFAULT_ASSISTANT_ACTIONS and DEFAULT_USER_ACTIONS — spread them and add your own.

Examples

Assistant — default actions

DEFAULT_ASSISTANT_ACTIONS: copy, regenerate, thumbs-up, thumbs-down. The wrapping pk-message + group container drives the hover-reveal.

AI Yes — Tailwind's color tokens flow through Spartan's CSS variables, so the kit picks up your theme without extra configuration.

User — default actions

DEFAULT_USER_ACTIONS: copy, edit. Wrap the user bubble in a group container the same way.

Does the kit pick up my Spartan theme automatically?

Custom set with active state

Spread the defaults and add your own (Bookmark + Share). The active flag lights the button with bg-accent + text-primary — consumer manages active state in its own signal.

AI Click thumbs-up to see the active state — it persists across hover-reveal so the consumer can read 'this message was rated good'.

Composed with pk-message-edit

When composing with pk-message-edit, suppress its built-in pencil via editTrigger='hidden' and call editor.startEdit() from the edit action's handler. The edit state machine stays in pk-message-edit; this component just emits intent.

Could you summarise the latest commit log into release notes?

Installation

Add the message-actions-bar component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:message-actions-bar

Component API

PkMessageActionsBar

PropTypeDefaultDescription
actionsreadonly MessageAction[]Buttons to render (required).
visible"hover" | "always" "hover" hover: opacity-0 with group-hover/group-focus-within reveal — consumer wraps the message + bar in a group div. always: no transition.
orientation"horizontal" | "vertical" "horizontal" Vertical lays the buttons in a column for sidebar-style placements.
classstringExtra classes for the host.

MessageAction interface

PropTypeDefaultDescription
idstringStable identifier — track-by + emitted from (actionPicked).
labelstringTooltip text + aria-label.
iconstringLucide icon name; consumer must register via provideIcons().
variant"default" | "destructive" "default" destructive paints the icon red.
disabledboolean false Greys the button and prevents (actionPicked).
activeboolean false Lights the button with bg-accent + text-primary; sets aria-pressed="true".

Outputs

PropTypeDefaultDescription
actionPicked(action: MessageAction) => voidThe picked action (full object, not just id).

Exports

PropTypeDefaultDescription
DEFAULT_ASSISTANT_ACTIONSreadonly MessageAction[]copy, regenerate, thumbs-up, thumbs-down.
DEFAULT_USER_ACTIONSreadonly MessageAction[]copy, edit.