TidalUI

Model selector preview

Search and compare a consumer-supplied model catalog, then choose a model and mode with exact native form values.

pro · Forms · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/model-selector

Import components/ui/tidal.css, components/ui/model-selector.css. Wrap installed components in tidal-scope.

Preview

Model selector component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/model-selector.css";
import{TidalModelSelector}from"./components/ui/model-selector";
export default(p:Parameters<typeof TidalModelSelector>[0])=><div className="tidal-scope"><TidalModelSelector {...p}/></div>;

API and props

TidalModelSelector.groups (required)
ReadonlyArray<TidalModelGroup>

Required groups value accepted by this exported component.

TidalModelSelector.onModeChange (required)
(modeId: string, event: SelectionEvent) => void

Callback invoked when the mode change interaction is proposed.

TidalModelSelector.onModelChange (required)
(modelId: string, event: SelectionEvent) => void

Callback invoked when the model change interaction is proposed.

TidalModelSelector.onQueryChange (required)
(query: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the query change interaction is proposed.

TidalModelSelector.query (required)
string

Required query value accepted by this exported component.

TidalModelSelector.selectedModeId (required)
string | null

Required selected mode id value accepted by this exported component.

TidalModelSelector.selectedModelId (required)
string | null

Required selected model id value accepted by this exported component.

TidalModelSelector.description
ReactNode

Optional description value accepted by this exported component.

TidalModelSelector.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalModelSelector.empty
ReactNode

Optional empty value accepted by this exported component.

TidalModelSelector.footer
ReactNode

Optional footer value accepted by this exported component.

TidalModelSelector.form
string | undefined

Optional form value accepted by this exported component.

TidalModelSelector.labels
Partial<{ search: string; searchPlaceholder: string; models: string; modes: string; context: string; cost: string; capabilities: string; available: string; preview: string; unavailable: string; results: (visible: number, total: number) => string; choose: string; invalid: string; unknownModel: string; unknownMode: string; selectionOutsideResults: string; }> | undefined

Optional labels value accepted by this exported component.

TidalModelSelector.modeInputProps
HiddenInputProps | undefined

Optional mode input props value accepted by this exported component.

TidalModelSelector.modeInputRef
Ref<HTMLInputElement> | undefined

Optional mode input ref value accepted by this exported component.

TidalModelSelector.modelInputProps
HiddenInputProps | undefined

Optional model input props value accepted by this exported component.

TidalModelSelector.modelInputRef
Ref<HTMLInputElement> | undefined

Optional model input ref value accepted by this exported component.

TidalModelSelector.modelName
string | undefined

Optional model name value accepted by this exported component.

TidalModelSelector.modeName
string | undefined

Optional mode name value accepted by this exported component.

TidalModelSelector.searchInputProps
SearchInputProps | undefined

Optional search input props value accepted by this exported component.

TidalModelSelector.searchInputRef
Ref<HTMLInputElement> | undefined

Optional search input ref value accepted by this exported component.

TidalModelSelector.title
ReactNode

Optional title value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas