# Define unfold

A term that explains itself like a folded note opening out of its underline.

Also called: inline definition, glossary tooltip.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A term that explains itself. Point at a term and its underline draws across; the definition unfolds out of the line in two panels like a folded note, and folds back up the same way. Preview: https://chatcn.dev/preview/define-unfold-demo

Point at a dotted term and its underline draws across; then the definition unfolds out of the line in two panels, the top swinging down and the second unfolding from its edge, the crease catching a little shadow as it opens. It folds back up the same way.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/define-unfold
```

## Usage

```tsx
import { DefineUnfold } from "@/components/ui/chatcn/pro/define-unfold"

<p>
  Answers stream faster once the <DefineUnfold term="KV cache" source="From the glossary">Keys and values kept from earlier tokens.</DefineUnfold> is warm.
</p>
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `term` | `string` | The word in the text |
| `children` | `ReactNode` | The definition |
| `source` | `string` | Where it comes from |
| `open` / `onOpenChange` | `boolean` | Optional control |

## Keyboard

| Key | Action |
| --- | --- |
| `Tab` | Focus the term, which opens it |
| `Escape` | Fold it |

## Accessibility

- The term is a button with `aria-expanded`; the note describes it.

## Motion

- Underline 220 ms, then two 3D panels, 200 and 300 ms. Reduced motion: it shows and hides.

Source: https://chatcn.dev/docs/components/define-unfold