Chain Of Thought
Vertical reasoning timeline. Each step is independently expandable; the connecting line stops at the last step.
Examples
Three-step reasoning
Default circle markers. Mark the final step with [last]=true so the connecting line ends cleanly.
refreshSession and verifyToken. <pk-chain-of-thought>
<pk-chain-of-thought-step>
<pk-chain-of-thought-trigger>Read the input prompt</pk-chain-of-thought-trigger>
<pk-chain-of-thought-content>
<pk-chain-of-thought-item>Parsed 3 paragraphs and 2 code blocks.</pk-chain-of-thought-item>
</pk-chain-of-thought-content>
</pk-chain-of-thought-step>
<!-- ...more steps... -->
<pk-chain-of-thought-step [last]="true">
<pk-chain-of-thought-trigger>Compose the answer</pk-chain-of-thought-trigger>
<pk-chain-of-thought-content>
<pk-chain-of-thought-item>Recommend extracting the token-refresh path.</pk-chain-of-thought-item>
</pk-chain-of-thought-content>
</pk-chain-of-thought-step>
</pk-chain-of-thought>With per-step icons
Set [leftIcon]=true on the trigger and project a custom icon via the [leftIcon] attribute slot. Hover swaps it for the chevron.
<pk-chain-of-thought-step>
<pk-chain-of-thought-trigger [leftIcon]="true">
<ng-icon leftIcon hlm size="xs" name="lucideSearch" />
Research phase: Understanding the problem space
</pk-chain-of-thought-trigger>
<pk-chain-of-thought-content>
<pk-chain-of-thought-item>...</pk-chain-of-thought-item>
</pk-chain-of-thought-content>
</pk-chain-of-thought-step>Installation
Add the chain-of-thought component (and the cn() utility) to your project.
ng generate ngx-prompt-kit:chain-of-thoughtComponent API
PkChainOfThought
| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | Extra classes for the wrapper. |
PkChainOfThoughtStep
| Prop | Type | Default | Description |
|---|---|---|---|
| open | model<boolean> | — | Two-way bound open state. Leave unbound for uncontrolled. |
| defaultOpen | boolean | false | Initial expanded state when uncontrolled. |
| last | boolean | false | Marks the final step so the connecting line stops here. |
PkChainOfThoughtTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| leftIcon | boolean | false | Reserve a left-icon slot. Project the icon via the [leftIcon] attribute (e.g. <ng-icon leftIcon hlm name="lucideSearch" />). |
| swapIconOnHover | boolean | true | Swap leftIcon for the chevron on hover. |
| class | string | — | Extra classes for the trigger. |
PkChainOfThoughtContent
| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | Extra classes for the collapsing wrapper. |
PkChainOfThoughtItem
| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | Extra classes for the item. |