Picks the model, and its reasoning effort, for an AI composer.
Picks the model, and its reasoning effort, for an AI composer.
import { ModelSelector } from 'heroui-native-pro' ;
< ModelSelector models ={models}>
< ModelSelector.Trigger />
< ModelSelector.Content >
< ModelSelector.Search />
< ModelSelector.List >
< ModelSelector.Group title = "..." >
< ModelSelector.Item model ={model} />
</ ModelSelector.Group >
</ ModelSelector.List >
< ModelSelector.Effort />
</ ModelSelector.Content >
</ ModelSelector >
ModelSelector : Root that wraps heroui-native Select. Owns the selected model id, the effort level, the copy (labels), and the presentation. With no children it renders Trigger and Content.
ModelSelector.Trigger : Ghost Button with the selected model's icon, short name, and a chevron that turns as the content opens.
ModelSelector.Content : Renders Select.Portal, Select.Overlay, and Select.Content with the root's presentation: a popover anchored to the trigger or a bottom sheet. With no children it renders List and Effort.
ModelSelector.Search : Optional search field. It filters the list by model or provider name, ignoring case and diacritics.
ModelSelector.List : Scrollable list with a title. With no children it groups models by provider. Shows an empty state when a search matches nothing.
ModelSelector.Group : Optional titled section, such as one provider. Its title hides while a search leaves it empty.
ModelSelector.Item : One model row: icon, name, badge, children as trailing meta, and the check indicator. Screen readers read the badge, description, ratings, and context window as the row's hint.
ModelSelector.Effort : Optional slider over the selected model's effort levels. Max levels add a sheen; Ultra adds a glow and sparks. Hidden for models with fewer than two levels.
With no children, the root renders the default trigger and content, grouped by provider.
< ModelSelector models ={models} defaultValue = "claude-opus-5-5" />
Place the selector in PromptInput.ToolbarEnd, before the send button. The popover opens above the trigger.
< PromptInput.ToolbarEnd >
< ModelSelector
models ={models}
defaultValue = "claude-opus-5-5"
defaultEffort = "ultra"
>
< ModelSelector.Trigger />
< ModelSelector.Content >
< ModelSelector.List >
{providers. map ((provider) => (
< ModelSelector.Group key ={provider} title ={provider}>
{models
. filter ((model) => model.provider === provider)
. map ((model) => (
< ModelSelector.Item key ={model.id} model ={model} />
))}
</ ModelSelector.Group >
))}
</ ModelSelector.List >
< ModelSelector.Effort />
</ ModelSelector.Content >
</ ModelSelector >
< PromptInput.Send />
</ PromptInput.ToolbarEnd >
Set presentation on the root. ModelSelector.Content follows it. The sheet sizes to its content and the list scrolls inside it.
< ModelSelector models ={models} presentation = "bottom-sheet" />
ModelSelector.Search fixes the list height, so the content keeps its size while the search narrows the list. It does not focus on open by default; pass autoFocus to change that. The bottom sheet keeps the field above the keyboard.
< ModelSelector models ={moreModels} presentation = "bottom-sheet" >
< ModelSelector.Trigger />
< ModelSelector.Content >
< ModelSelector.Search />
< ModelSelector.List />
< ModelSelector.Effort />
</ ModelSelector.Content >
</ ModelSelector >
ModelSelector.Item children render after the name, such as a price. Screen readers read them after the name.
< ModelSelector.Item model ={model}>{prices[model.id]}</ ModelSelector.Item >
Give a model efforts from lowest to highest. tone: 'max' adds a sheen and tone: 'ultra' adds a glow and sparks. Give Ultra to the last level, since it draws at the track end. A level's description shows under the slider and is read as the slider value. The note row keeps the height of the tallest description, so moving the slider never shifts the layout.
const efforts: ModelSelectorEffortLevel [] = [
{ id: 'low' , label: 'Low' },
{ id: 'medium' , label: 'Medium' },
{ id: 'high' , label: 'High' },
{
id: 'max' ,
label: 'Max' ,
description: 'Max uses your usage limit faster.' ,
tone: 'max' ,
},
{
id: 'ultra' ,
label: 'Ultra' ,
description: 'Ultra uses your limit fastest.' ,
tone: 'ultra' ,
},
];
Control the model with value and onChange, and the level with effort and onEffortChange. When a picked model lacks the current level, the effort falls back to the model's defaultEffort (else its first level), and onEffortChange reports it. Switching back to a model that has the earlier level restores it.
const [model, setModel] = useState ( 'claude-opus-5-5' );
const [effort, setEffort] = useState ( 'high' );
< ModelSelector
models ={models}
value ={model}
onChange ={setModel}
effort ={effort}
onEffortChange ={setEffort}
/>;
Children of ModelSelector.Effort replace the Faster and Smarter row under the track. title={null} removes the list title.
< ModelSelector models ={models} defaultValue = "claude-sonnet-5-5" >
< ModelSelector.Trigger />
< ModelSelector.Content >
< ModelSelector.List title ={ null } />
< ModelSelector.Effort >
< Text className = "text-xs text-muted" >Quick</ Text >
< Text className = "text-xs text-muted" >Thorough</ Text >
</ ModelSelector.Effort >
</ ModelSelector.Content >
</ ModelSelector >
Set isDisabled on a model to list it without letting it be picked. Set isDisabled on the root to disable the whole selector.
< ModelSelector
models ={models. map ((model) =>
model.id === 'claude-fable-5-2' ? { ...model, isDisabled: true } : model
)}
/>
< ModelSelector models ={models} isDisabled />
Every visible and spoken string comes from labels. Pass the entries to translate; the rest keep their English defaults.
< ModelSelector
models ={models}
labels ={{
effort: 'Esfuerzo' ,
faster: 'Más rápido' ,
smarter: 'Más inteligente' ,
title: 'Modelos' ,
trigger: 'Modelo' ,
emptyTitle : (query) => `Ningún modelo coincide con “ ${ query } ”` ,
}}
/>
icon renders in a 16×16 slot in the trigger and the rows. Size it to fill its parent.
const AnthropicLogo = () => (
< Svg width = "100%" height = "100%" viewBox = "0 0 256 257" >
< Path fill = "#d97757" d = "..." />
</ Svg >
);
import { useToast } from 'heroui-native' ;
import type {
ModelSelectorEffortLevel,
ModelSelectorModel,
} from 'heroui-native-pro' ;
import { ModelSelector, PromptInput } from 'heroui-native-pro' ;
import { useState } from 'react' ;
import { AnthropicLogo, OpenAILogo } from './logos' ;
const EFFORTS: ModelSelectorEffortLevel [] = [
{ id: 'low' , label: 'Low' },
{ id: 'medium' , label: 'Medium' },
{ id: 'high' , label: 'High' },
{
id: 'max' ,
label: 'Max' ,
description: 'Max uses your usage limit faster.' ,
tone: 'max' ,
},
{
id: 'ultra' ,
label: 'Ultra' ,
description: 'Ultra uses your limit fastest.' ,
tone: 'ultra' ,
},
];
const MODELS: ModelSelectorModel [] = [
{
id: 'claude-fable-5-2' ,
name: 'Claude Fable 5.2' ,
shortName: 'Fable 5.2' ,
provider: 'Anthropic' ,
badge: 'New' ,
description: 'For demanding reasoning and long-horizon agentic work.' ,
icon: < AnthropicLogo />,
contextWindow: 1_000_000 ,
intelligence: 5 ,
speed: 2 ,
efforts: EFFORTS,
defaultEffort: 'medium' ,
},
{
id: 'claude-opus-5-5' ,
name: 'Claude Opus 5.5' ,
shortName: 'Opus 5.5' ,
provider: 'Anthropic' ,
description: 'Frontier intelligence for complex coding and agents.' ,
icon: < AnthropicLogo />,
contextWindow: 1_000_000 ,
intelligence: 5 ,
speed: 3 ,
efforts: EFFORTS,
defaultEffort: 'medium' ,
},
{
id: 'claude-sonnet-5-5' ,
name: 'Claude Sonnet 5.5' ,
shortName: 'Sonnet 5.5' ,
provider: 'Anthropic' ,
description: 'Balanced speed and intelligence for everyday work.' ,
icon: < AnthropicLogo />,
contextWindow: 1_000_000 ,
intelligence: 4 ,
speed: 4 ,
efforts: EFFORTS. slice ( 0 , 4 ),
defaultEffort: 'medium' ,
},
{
id: 'gpt-6-1-sol' ,
name: 'GPT-6.1 Sol' ,
provider: 'OpenAI' ,
description: 'Near-Astra performance for complex work at a lower cost.' ,
icon: < OpenAILogo />,
contextWindow: 1_050_000 ,
intelligence: 4 ,
speed: 3 ,
},
];
const PROVIDERS = [... new Set (MODELS. map ((model) => model.provider))];
export default function Composer () {
const { toast } = useToast ();
const [value, setValue] = useState ( '' );
return (
< PromptInput
value ={value}
onValueChange ={setValue}
onSubmit ={(text) => {
toast. show ({ label: 'Sent' , description: text });
setValue ( '' );
}}
>
< PromptInput.Shell >
< PromptInput.Content >
< PromptInput.TextArea placeholder = "Ask anything" />
</ PromptInput.Content >
< PromptInput.Toolbar >
< PromptInput.ToolbarEnd >
< ModelSelector
models ={MODELS}
defaultValue = "claude-opus-5-5"
defaultEffort = "ultra"
>
< ModelSelector.Trigger />
< ModelSelector.Content >
< ModelSelector.List >
{PROVIDERS. map ((provider) => (
< ModelSelector.Group key ={provider} title ={provider}>
{MODELS. filter (
(model) => model.provider === provider
). map ((model) => (
< ModelSelector.Item key ={model.id} model ={model} />
))}
</ ModelSelector.Group >
))}
</ ModelSelector.List >
< ModelSelector.Effort />
</ ModelSelector.Content >
</ ModelSelector >
< PromptInput.Send />
</ PromptInput.ToolbarEnd >
</ PromptInput.Toolbar >
</ PromptInput.Shell >
</ PromptInput >
);
}
prop type default description childrenReactNodeTrigger and ContentTrigger and content parts modelsModelSelectorModel[]- Models to pick from (required) presentation'popover' | 'bottom-sheet''popover'How the content is presented valuestring- Selected model id (controlled) defaultValuestringfirst enabled model Initial model id (uncontrolled) effortstring- Selected effort level id (controlled) defaultEffortstringselected model's defaultEffort, else its first level Initial effort level id (uncontrolled) isOpenboolean- Open state (controlled) isDefaultOpenboolean- Initial open state (uncontrolled) isDisabledboolean- Disables the trigger classNamestring- Additional CSS classes for the root labelsPartial<ModelSelectorLabels>- Replaces the visible and spoken copy, for example to localize it accessibilityLabelstringlabels.triggerNames the trigger for screen readers. The trigger reads it, then the model name onChange(value: string) => void- Called when the user picks a model onEffortChange(effort: string) => void- Called when the user moves the slider, and when the level falls back onOpenChange(open: boolean) => void- Called when the open state changes animationModelSelectorRootAnimation- 'disable-all' disables every animation of the selector and its parts...ViewPropsViewProps- All standard React Native View props are supported
prop type default description idstring- Stable identifier, used as the value (required) namestring- Full name, shown in the rows (required) shortNamestringnameName shown in the trigger providerstring- Groups the default list; models without one are listed without a title descriptionstring- Read in the row's accessibility hint badgestring- Short label after the name, such as "New" iconReactNode- Provider logo, laid out in a 16×16 slot contextWindownumber- Context window in tokens, read in the hint as "1 million" intelligencenumber- Rating from 1 to 5, read in the hint speednumber- Rating from 1 to 5, read in the hint effortsModelSelectorEffortLevel[]- Levels from lowest to highest. Fewer than two hides the slider defaultEffortstring- Level used when the current one is not one of this model's levels isDisabledboolean- Whether the model is listed but cannot be picked
prop type default description idstring- Stable identifier, reported by onEffortChange (required) labelstring- Visible level name, such as "High" (required) descriptionstring- Usage note under the slider; read as the slider value tone'max' | 'ultra'- 'max' adds a sheen; 'ultra' adds a glow and sparks
prop type default description contextWindowstring'context window'Text after the spoken context window size effortstring'Effort'Slider label emptyHintstring'Try a model or provider name.'Second line of the empty search state emptyTitle(query: string) => string(query) => `No models match “${query}”`First line of the empty search state, also announced fasterstring'Faster'Start end of the slider intelligencestring'Intelligence'Intelligence rating label rating(value: number, max: number) => string(value, max) => `${value} of ${max}`Spoken rating searchPlaceholderstring'Search models'Search placeholder and accessibility label smarterstring'Smarter'End of the slider speedstring'Speed'Speed rating label titlestring'Models'Text above the list triggerstring'Model'Names the trigger for screen readers speakContextWindow(tokens: number) => stringlong English notation, such as "1 million" Spoken context window size
Animation configuration for the root. Can be:
'disable-all': Disable all animations, including the trigger chevron, the content, and the effort slider
undefined: Use default animations
prop type default description childrenReactNodeicon, short name, and chevron Replaces the trigger content variantButtonVariant'ghost'heroui-native Button variant sizeButtonSize'sm'heroui-native Button size. sm is 32px tall hitSlopInsets6 on each sideExtends the touch target to 44pt isDisabledbooleanroot isDisabled Whether the trigger is disabled classNamestring- Additional CSS classes accessibilityLabelstring'{label}, {model name}'Screen reader label ...ButtonRootPropsButtonRootProps- heroui-native Button props
The root's presentation decides which Select.Content props apply.
prop type default description childrenReactNodeList and EffortSearch, list, and effort parts placement'top' | 'bottom' | 'left' | 'right''top'Popover placement align'start' | 'center' | 'end''end'Popover alignment widthnumber | 'trigger' | 'content-fit' | 'full'288Popover width detentsSheetDetent[]['auto']Bottom-sheet detents. 'auto' sizes to the content scrollableRefRefObjectthe list Bottom-sheet scrollable classNamestring- Additional CSS classes for the popover contentContainerClassNamestring- Additional CSS classes for the bottom-sheet content portalPropsOmit<SelectPortalProps, 'children'>- Props for Select.Portal overlayPropsSelectOverlayProps- Props for Select.Overlay ...SelectContentPropsSelectContentProps- heroui-native Select.Content props, without presentation
prop type default description childrenReactNodeicon, input, clear button Replaces the default SearchField composition placeholderstringlabels.searchPlaceholderPlaceholder of the default input autoFocusbooleanfalseWhether the default input focuses when the content opens classNamestring- Additional CSS classes inputPropsSearchFieldInputProps- Props for the default SearchField.Input (secondary variant) ...SearchFieldPropsSearchFieldProps- heroui-native SearchField props, without value and onChange
placeholder, autoFocus, and inputProps apply only to the default input.
prop type default description childrenReactNodemodels by provider Groups and items titleReactNodelabels.titleText above the list. null removes it keyboardShouldPersistTaps'always' | 'never' | 'handled''handled'Keeps a row press to one tap while the keyboard is open showsVerticalScrollIndicatorbooleanfalseWhether the scroll indicator shows classNamestring- Additional CSS classes for the scroll view classNamesElementSlots<ListSlots>- Additional CSS classes for the slots styles{ title?: TextStyle; list?: ViewStyle }- Styles for the slots ...ScrollViewPropsScrollViewProps- All standard React Native ScrollView props are supported
prop type description titlestringText above the list liststringScroll view
prop type description titleTextStyleText above the list listViewStyleScroll view
prop type default description childrenReactNode- The group's ModelSelector.Items titleReactNode- Group heading, such as the provider name classNamestring- Additional CSS classes for the container classNamesElementSlots<GroupSlots>- Additional CSS classes for the slots styles{ container?: ViewStyle; title?: TextStyle }- Styles for the slots ...ViewPropsViewProps- All standard React Native View props are supported
prop type description containerstringGroup column titlestringGroup heading
prop type description containerViewStyleGroup column titleTextStyleGroup heading
prop type default description childrenReactNode- Trailing meta after the name, such as a price modelModelSelectorModel- The model this row picks (required) classNamestring- Additional CSS classes for the row classNamesElementSlots<ItemSlots>- Additional CSS classes for the slots styles{ container?: ViewStyle; icon?: ViewStyle; name?: TextStyle; meta?: TextStyle }- Styles for the slots accessibilityLabelstringmodel name and meta Screen reader label accessibilityHintstringbadge, description, ratings, and context window Screen reader hint ...SelectItemPropsSelectItemProps- heroui-native Select.Item props, without value, label, disabled, and children
prop type description containerstringRow iconstring16×16 icon slot namestringModel name badgestringBadge Chip metastringTrailing meta text indicatorstring16×16 check slot, reserved on every row so badges and meta line up
prop type description containerViewStyleRow iconViewStyleIcon slot nameTextStyleModel name metaTextStyleTrailing meta text
prop type default description childrenReactNodeFaster and Smarter Replaces the row under the track. null removes it isDisabledbooleanfalseWhether the slider is disabled. Disabled sliders show no effects showOuterSparksbooleantrueShows Ultra's particles outside the track; in-track effects stay classNamestring- Additional CSS classes for the slider classNamesElementSlots<EffortSlots>- Additional CSS classes for the slots animationModelSelectorEffortAnimation- Step timing and effect durations ...SliderPropsSliderProps- heroui-native Slider props, without the value, range, and animation props
prop type description separatorstringSeparator above the slider, between list and sliderheaderstringRow with the label and the level name labelstringSlider label valuestringActive level name bodystringTrack and the row under it trackstringTrack fillstringFill up to the thumb thumbstringThumb container thumbKnobstringThumb knob glowstringUltra glow around the track endsstringRow under the track hintstringNote row under the slider
Animation configuration for the effort slider. Can be:
false or 'disabled': Levels snap and the Max and Ultra effects stay still
true or undefined: Use default animations
object: Custom animation configuration
Reduced motion also snaps the levels and stops the effects.
prop type default description state'disabled' | boolean- Disable animations while customizing properties step.timingConfigWithTimingConfig{ duration: 200, easing: Easing.bezier(0.23, 1, 0.32, 1) }Thumb and fill travel between levels sheen.durationnumber8000Length of one Max sheen pass and its rest, in ms glow.durationnumber10000Length of one Ultra glow breath, in ms
Reads the root state inside any ModelSelector part.
property type description modelsModelSelectorModel[]Models to pick from modelModelSelectorModel | undefinedSelected model effortstring | nullSelected effort level id, or null when the model has no efforts setEffort(effort: string) => voidPicks an effort level labelsModelSelectorLabelsResolved copy labelstringAccessibility label of the trigger, before the model name presentation'popover' | 'bottom-sheet'How the content is presented