AI
Capability Selector
A controlled multi-select grid of toggleable model capabilities that adapts to the model type.
A multi-select grid of toggleable model capabilities. It is fully controlled — you own the selected array and update it from onChange. The option set adapts to modelType (defaults to the LLM set: chat, streaming, function calling, vision, thinking).
Import
import { CapabilitySelector } from "@yuhuanowo/yunui/ai";
Basic
Because it is controlled, hold the selection in state and pass it back via onChange.
Basic
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | 2 | 3 | 4 | 4 | Grid column count. |
| disabled | boolean | false | Disable interaction and dim the control. |
| modelType | string | — | Filters which capability set is shown (e.g. "image_generation", "audio", "video"). Defaults to the LLM set. |
| onChange* | (capabilities: string[]) => void | — | Called with the next selection when a capability is toggled. |
| selected* | string[] | — | Currently selected capability keys (controlled). |
| size | "sm" | "md" | md | Button size: `sm` or `md` (default). |