# AuditTrail

A searchable history of actions and their outcomes, with sensitive fields hidden.

- **Use it for**: Searchable history of actions with outcomes.
- **Not for**: Live runs. Try [RunBoard](https://unseenui.com/components/run-board/).

## Installation

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

## Usage

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

<AuditTrail variant="timeline" records={records} query={query} onQueryChange={setQuery} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `loading` | `boolean` |  |
| `onLoadMore` | `(() => void)` |  |
| `onQueryChange` (required) | `(query: string) => void` |  |
| `query` (required) | `string` |  |
| `records` (required) | `readonly AuditRecord[]` | A host-owned window of up to 200 records. |
| `variant` | `"table" \| "compact" \| "timeline"` |  |

## 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

[AgentHandoff](https://unseenui.com/components/agent-handoff/), [PolicyStatus](https://unseenui.com/components/policy-status/), [AgentCard](https://unseenui.com/components/agent-card/)

Page: https://unseenui.com/components/audit-trail/
