ngx-prompt-kit

Reasoning

A collapsible component for showing AI reasoning, explanations, or logic. Auto-expands while a stream is in progress and collapses when it ends. Markdown supported.

Examples

Basic Usage

The most basic implementation of the Reasoning component with auto-close functionality when streaming ends.

With Markdown

Show rich formatting with markdown support for better structured reasoning content.

Installation

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

ng generate ngx-prompt-kit:reasoning

Component API

PkReasoning

PropTypeDefaultDescription
openmodel<boolean>Two-way bound open state. Leave unbound for uncontrolled.
isStreamingboolean false Auto-opens while true; auto-closes when it flips back to false.
classstringExtra classes for the wrapper.

PkReasoningTrigger

PropTypeDefaultDescription
classstringExtra classes for the trigger button.

PkReasoningContent

PropTypeDefaultDescription
contentstringThe body text. Optional — projected ng-content also supported.
markdownboolean false Render content as markdown via pk-markdown.
classstringExtra classes for the outer collapsing wrapper.
contentClassstringExtra classes for the inner content (use this for borders / padding so they collapse with the panel).