Model Select

Picks which model answers. A Select with the naming convention folded in, so "Opus · most capable" is scannable where a bare model id is not.

src/components/ui/model-select.tsx

About

From the component's own source, where it was written.

Picks which model answers.

A Select with the naming convention folded in: the family and the tier read as one line, so "Opus · most capable" is scannable where a bare model id is not.

Install

npx astralyx-ui add model-select

Usage

import { ModelSelect } from '@/components/ui/model-select'

<ModelSelect models={models} value={model} onValueChange={setModel} />

Composer

Change the props and the source below follows.

Props
tsx
<ModelSelect
  models={models}
  size="sm"
  onValueChange={setModel}
/>

Examples

Model picker

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

ModelSelect

Picks which model answers.

Extends Omit<ComponentProps<typeof Select>, 'options'>.

PropTypeDefaultDescription
defaultValuestring——
valuestring——
errorboolean——
disabledboolean——
variant'default' | 'secondary' | 'ghost'——
size'sm' | 'default' | 'xs' | 'lg' | 'xl''sm'—
iconReactNode——
onValueChange(value: string) => void——
placeholderstring'Model'—
emptyMessageReactNode—Shown when options is empty.
triggerClassNamestring——
triggerLabelstring—Accessible name for the trigger.
modelsModel[]required{ id, name, note?, disabled? }

Types

Model

FieldTypeDescription
idstring—
namestring—
note?stringCapability or cost hint, joined to the name with a middot.
disabled?boolean—

Behaviour

TopicDetailDescription
restSelect propsEverything else forwards to Select — value, onValueChange, size, variant, error.