# Sources

A "Used N sources" disclosure with safe links.

- **Use it for**: A compact "Used N sources" disclosure under a reply.
- **Not for**: Linking a specific passage. Try [Citation](https://unseenui.com/components/citation/), [SourceCard](https://unseenui.com/components/source-card/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { Sources } from '@stackunseen/ui/assistant';
import '@stackunseen/ui/styles.css';

<Sources sources={sources} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` |  |
| `defaultOpen` | `boolean` |  |
| `labels` | `Partial<SourcesLabels>` | Replaces the built-in wording, for example to translate it. |
| `onOpenChange` | `((open: boolean) => void)` |  |
| `open` | `boolean` |  |
| `sources` (required) | `readonly SourceLink[]` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[SourceCard](https://unseenui.com/components/source-card/), [Citation](https://unseenui.com/components/citation/), [EvidenceGroup](https://unseenui.com/components/evidence-group/), [GroundingStatus](https://unseenui.com/components/grounding-status/), [ProvenanceBadge](https://unseenui.com/components/provenance-badge/), [ConfidenceNote](https://unseenui.com/components/confidence-note/)

Page: https://unseenui.com/components/sources/
