# ModelControls

Model capabilities, settings and usage, each showing where the value came from.

- **Use it for**: Model capabilities, settings and usage with their sources.
- **Not for**: Just choosing a model. Try [ModelSelector](https://unseenui.com/components/model-selector/).

## Installation

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

## Usage

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

<ModelControls variant="panel" capabilities={capabilities} value={settings} onValueChange={setSettings} usage={usage} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `capabilities` | `ModelCapabilities` |  |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `disabled` | `boolean` |  |
| `error` | `string` |  |
| `onRefresh` | `(() => void)` |  |
| `onValueChange` (required) | `(settings: ModelSettings) => void` |  |
| `stale` | `boolean` |  |
| `status` | `"ready" \| "loading" \| "failed"` |  |
| `usage` | `ModelUsage` |  |
| `value` (required) | `ModelSettings` |  |
| `variant` | `"compact" \| "accordion" \| "panel"` |  |

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

[ModelSelector](https://unseenui.com/components/model-selector/)

Page: https://unseenui.com/components/model-controls/
