> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pharen.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Chain of thought

> Import and use the Chain of thought components from @pharen/ui/components/ai.

export const PharenUiPreview = ({name, title = 'Pharen UI component preview'}) => <div className="not-prose my-6 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-zinc-950">
    <div className="pharen-ui-preview-root" data-pharen-ui-preview data-example={name} role="region" aria-label={title} />
  </div>;

Use **Chain of thought** to build AI interfaces. This page covers every Vue component exported by the public module.

<PharenUiPreview name="chain-of-thought" title="Chain of thought preview" />

<Accordion title="View code">
  ```vue theme={null}
  <script setup lang="ts">
  import { ChainOfThought, ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtStep } from '@pharen/ui/components/ai';
  </script>

  <template>
    <ChainOfThought default-open class="w-full max-w-lg">
      <ChainOfThoughtHeader>How the answer was prepared</ChainOfThoughtHeader>
      <ChainOfThoughtContent>
        <ChainOfThoughtStep label="Searched the workspace" description="Found 12 related documents." icon="lucide:search" status="complete" />
        <ChainOfThoughtStep label="Compared the results" description="Checked dates and duplicate entries." icon="lucide:list-checks" status="active" :spin="false" last />
      </ChainOfThoughtContent>
    </ChainOfThought>
  </template>
  ```
</Accordion>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @pharen/ui
  ```

  ```bash pnpm theme={null}
  pnpm add @pharen/ui
  ```

  ```bash yarn theme={null}
  yarn add @pharen/ui
  ```

  ```bash bun theme={null}
  bun add @pharen/ui
  ```
</CodeGroup>

<Note>
  Import `@pharen/ui/styles.css` exactly once in your application entrypoint.
</Note>

## Usage

```ts theme={null}
import { ChainOfThought, ChainOfThoughtHeader, ChainOfThoughtContent, ChainOfThoughtStep, ChainOfThoughtSearchResults, ChainOfThoughtSearchResult, ChainOfThoughtImage } from '@pharen/ui/components/ai';
```

## Exports

| Export                        | Purpose                                  |
| ----------------------------- | ---------------------------------------- |
| `ChainOfThought`              | Exported Vue component from this module. |
| `ChainOfThoughtHeader`        | Structures the header region.            |
| `ChainOfThoughtContent`       | Contains the visible content.            |
| `ChainOfThoughtStep`          | Exported Vue component from this module. |
| `ChainOfThoughtSearchResults` | Exported Vue component from this module. |
| `ChainOfThoughtSearchResult`  | Exported Vue component from this module. |
| `ChainOfThoughtImage`         | Exported Vue component from this module. |

## Source

[Open the source on GitHub](https://github.com/PharenIT/ELEV8-Labs/tree/main/src/packages/ui/src/components/ai/chain-of-thought)
