Skip to main content
Version: Next

AIModelSelector

The AIModelSelector component provides a grouped dropdown menu to switch between different active language models (LLMs). The models are organized and separated by provider headers. It wraps the Radix-based Dropdown primitive to inherit focus trapping and keyboard navigation commands (arrow keys, enter, escape).

Installation

ignix add component ai-model-selector

Usage

import { AIModelSelector } from '@mindfiredigital/ignix-ui';

Basic Example

By default, the component populates list selections covering OpenAI, Anthropic, Google, and Meta models:

function SimpleSelector() {
const [model, setModel] = useState("gpt-4o");
return (
<AIModelSelector
selectedModelId={model}
onModelChange={(newModel) => setModel(newModel.id)}
/>
);
}

Trigger Variants

Tailor trigger borders and layout modes depending on visual requirements:

{/* Pill Shape / Small */}
<AIModelSelector selectedModelId="claude-3.5-sonnet" size="sm" />

{/* Glassmorphic */}
<AIModelSelector selectedModelId="gemini-1.5-pro" variant="glass" />

{/* Minimal / Borderless */}
<AIModelSelector selectedModelId="llama-3-70b" variant="minimal" />

Props

PropTypeDefaultDescription
selectedModelIdstring"gpt-4o"Currently selected model ID
modelsAIModel[]Default listArray of models available for selection
onModelChange(model: AIModel) => voidundefinedCallback fired when a model is selected
size'sm' | 'md' | 'lg''md'Trigger sizing ('sm' renders as fully rounded compact pill trigger)
variant'default' | 'dark' | 'glass' | 'minimal''default'Visual styling theme for the trigger and dropdown overlay content
placeholderstring"Select Model"Fallback label when selectedModelId does not match any list items