Skip to content
Sign in
BillingModel upsellMenu

Model upsellPro

Locked premium models inside the model list with a lock badge, what each unlocks and one upgrade action. A drop-in for the free model picker that also renders inline.

ProThe composer model menu with premium models locked in place and a pane that says what each unlocks.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/model-upsell

Usage

tsx
import { ModelUpsell } from "@/components/ui/chatcn/pro/model-upsell"

<ModelUpsell
  models={models} // free picker models, plus plan and unlocks on locked ones
  value={model}
  onValueChange={setModel}
  onUpgrade={(m) => openCheckout(m.plan)}
/>

Models use the free ModelOption shape. Add plan to lock one, unlocks for what it gives, and highlights for a few key numbers. Locked models stay reachable with the arrow keys so people can read what they unlock; Enter on one starts the upgrade, Enter on an unlocked one picks it.

Examples

Inline list

ProThe same list rendered in place for a settings page.

With the free picker

lockedAsDisabled(models) turns locked models into disabled rows that name their plan, for the plain free ModelPicker in dense toolbars.

ProLocked models as disabled rows in the free model picker, for dense toolbars.

Props

PropTypeNotes
modelsUpsellModelOption[]ModelOption plus plan?, unlocks?, highlights?
providersModelProvider[]Group names and order
value, defaultValue, onValueChangestringOnly unlocked models can be picked
onUpgrade(model) => unknownReturn a promise to show progress
upgradeLabel(plan) => stringDefault Upgrade to {plan}
renderProviderMark(id) => ReactNodeYour provider marks
inlinebooleanRender in place without a trigger
loading, disabled, size, side, align, open, onOpenChangeAs in the free picker
labelsPartial<ModelUpsellLabels>Every string the upsell shows or announces, for translation

Keyboard

KeyAction
TypingFilters by name, provider, plan or capability
ArrowUp, ArrowDownMove, locked models included
EnterPick, or upgrade on a locked model
TabReach the upgrade button in the detail pane

Accessibility

  • Locked options carry a description that names the plan; the badge reads as Pro plan.
  • The detail pane is a polite live region and describes the search box while a locked model is active.

Motion

  • The popover grows from the trigger in 180 ms. Highlight and the detail pane change instantly: they follow the keyboard.