ModelPicker
A model from a catalogue of any size: searchable, grouped by provider, recent models on top. The start of a comparison column's header.
function Basic() {
const [model, setModel] = useState("claude-sonnet-4-5");
return (
<div className="flex h-52 w-full max-w-360 items-center pl-8 hairline-b">
<ModelPicker value={model} onValueChange={setModel} options={playgroundModels} providers={providers} />
</div>
);
}import { ModelPicker } from "@logicplanes/kaeso-ui/playground";Props
allLabelstringSingle only: a first option for no model in particular, such as "All models"; choosing it reports an empty string.
appearance"ghost" | "default"A quiet button (
ghost) or a filled one (default).aria-labelstringWhat the picker is for ("Model" by default): it names the list and its popover, and the button, named by the model it shows, reads it as its description.
defaultValuestring | string[] | nullThe chosen model, or models with
multiple, on first render.descriptionReactNodeOne sentence of help under the label.
disabledbooleanTurns it off: it can't be used, and it looks dimmed.
fullWidthbooleanFills the container.
groupByProviderbooleanGroups the list by provider (true by default when there are several).
invalidbooleanShows it as invalid; pair it with a message that says what to fix.
labelReactNodeThe visible label.
layout"horizontal" | "vertical"The label above the control (
vertical) or beside it (horizontal).multiplebooleanAllows choosing several models;
valueis then a list.onOpenChange((open: boolean) => void)Called when the list opens or closes.
onValueChange((value: string) => void) | ((value: string[]) => void)Called with the chosen model, or the list of models with
multiple.openbooleanWhether the list is open, when you control it.
optionalbooleanAdds “Optional” to the label, for forms where most fields are required.
optionsModelPickerOption[]The models: value, provider, id, name, capabilities, context window, a formatted price, a short note such as why it is disabled, and whether it is deprecated.
placeholderstringText shown while there is no value.
providersModelPickerProvider[]The providers' names and whether each is connected; connected providers come first.
recentreadonly string[]Values of recently used models, shown first while the search is empty.
requiredbooleanMarks it as required in a form.
size"md" | "sm"The button's height.
valuestring | string[] | nullThe chosen model, or models with
multiple, when you control it.