# AI context features

A shadcn/ui features section for AI products that need to prove their answers: a live-versus-stale context chart beside a chat that cites its file.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available for the docs, pricing and about pages: append `.md` to the URL or send an `Accept: text/markdown` header (the home page answers the header too). An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

## At a glance

- **Good for:** AI assistant and knowledge-base product pages; Enterprise search and RAG platform landing pages; Developer tools that keep docs in sync with code; Product pages that compare a live system with a stale one
- **Category:** AI, Marketing · **Type:** Features · **Style:** Motion, Minimal, Dark mode
- **See it:** [Live preview](https://www.craftui.space/docs/templates/feature-section-05) · [Screenshot](https://www.craftui.space/llms.md/preview/feature-section-05.8cc5d0ef.jpg)

![AI context features](https://www.craftui.space/llms.md/preview/feature-section-05.8cc5d0ef.jpg)

## Install

```bash
pnpm dlx shadcn@latest add https://www.craftui.space/r/feature-section-05.json
```

This is a paid item (SEC-4GV1ZY): the install needs a craftUI plan or a purchase of it. Signed in, the docs page gives your personal install command. Plans: https://www.craftui.space/pricing

## Usage

```tsx
import ContextSection from "@/components/sections/feature-section-05/feature-section-05";

export default function Page() {
  return <ContextSection />;
}
```

With no props it renders with demo content; pass your own through the props below.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `ReactNode` | `"Answers are only as fresh as the context behind them"` | The section's headline. |
| `headingLevel` | `1 \| 2 \| 3` | `2` | The headline's level: 1 on a page it opens, 2 anywhere else. The two column titles sit one level below it. |
| `columns` | `[ContextColumn, ContextColumn]` | `built-in demo content` | The copy above the chart, then above the chat. |
| `defaultFront` | `"chart" \| "chat"` | `"chat"` | Which window starts in front: "chat" or "chart". With "chat" it answers as the section comes into view; with "chart" the chart plays first, then hands over to the chat. |
| `chart` | `FreshnessChartProps` | — | The chart's own props: your changes, file count, snapshot day, sources and title. Leave out for the demo. |
| `chat` | `SourceChatProps` | — | The chat's own props: the question, the answer, its second line, the file it names and the sources. Leave out for the demo. |

It also accepts every `<section>` attribute (`className`, `id`, `aria-*` and so on).

### `ContextColumn`

| Field | Type | Description |
| --- | --- | --- |
| `title` (required) | `string` | The window's name, e.g. "Live context". |
| `body` (required) | `string` | One sentence about it, in the muted colour. |
| `href` | `string` | Makes the title a link. |

### `FreshnessChartProps`

| Field | Type | Description |
| --- | --- | --- |
| `changes` | `ContextChange[]` | Every change since the snapshot. Leave out for the demo. |
| `files` | `number` | How many files are tracked in all. |
| `live` | `number` | The share still current with live updates, in percent. |
| `snapshot` | `Date \| string \| number` | The day the snapshot was built. |
| `now` | `Date \| string \| number` | Today: where the timeline ends. |
| `sources` | `ContextSource[]` | The lanes, top first. |
| `title` | `string` | The window's title. |
| `locale` | `string` | A BCP 47 locale for the dates. |
| `play` | `boolean` | Draws the chart in. Flip it to true when the chart is in view. |
| `pick` | `string` | A change to show while nothing is pointed at (for a guided demo). |
| `quiet` | `boolean` | Fades the right gutter (the lines' end labels) out at lg and up, for while the window beside the chart covers it. |

### `SourceChatProps`

| Field | Type | Description |
| --- | --- | --- |
| `crumbs` | `[string, string]` | The breadcrumb: where the chat lives, then its name. |
| `question` | `string` | What the visitor asked, in the bubble on the right. |
| `answer` | `string` | The assistant's answer. |
| `note` | `string` | The answer's second line: who changed which file. |
| `file` | `string` | The file that line names. Where it appears in `note` it is set apart in the accent colour. |
| `sources` | `ChatSource[]` | What the answer read, as a row of chips under it. |
| `play` | `boolean` | Starts the conversation. Flip it to true when the chat is in view. |

### `ContextChange`

| Field | Type | Description |
| --- | --- | --- |
| `id` (required) | `string` | A stable id for the change. |
| `at` (required) | `Date \| string \| number` | When it happened. |
| `file` (required) | `string` | The file that changed, e.g. "policies/refunds.md". |
| `source` (required) | `string` | Where the change came from. Names its lane. |
| `by` (required) | `string` | Who made it. |
| `before` (required) | `string` | The line as the snapshot has it. |
| `after` (required) | `string` | The line as it is now. |

### `ContextSource`

| Field | Type | Description |
| --- | --- | --- |
| `name` (required) | `string` | The source's name. A change belongs to the lane whose name matches its `source`. |
| `icon` (required) | `IconSvgElement` | Its icon: any icon from the Hugeicons core-free-icons package. |

### `ChatSource`

| Field | Type | Description |
| --- | --- | --- |
| `name` (required) | `string` | The source's name, shown on its chip. |
| `icon` (required) | `IconSvgElement` | Its icon: any icon from the Hugeicons core-free-icons package. |

## Files

The install adds:

- `components/sections/feature-section-05/feature-section-05.tsx`
- `components/sections/feature-section-05/freshness-chart.tsx`
- `components/sections/feature-section-05/source-chat.tsx`

npm dependencies (installed for you): `@hugeicons/core-free-icons`, `@hugeicons/react`, `@number-flow/react`, `motion`.

shadcn/ui components it uses (the shadcn CLI adds any that are missing): `badge`, `card`.