Skip to main content
Clever Ops

Model Picker Row

A segmented row of model options, name over quiet mono context, speed, and cost data, with a spring-loaded sliding thumb marking the selection; display plus callback only.

Preview & code

Loading Model Picker Row preview

Installation

pnpm dlx shadcn@latest add @cleverui/model-picker-row

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { ModelPickerRow } from '@/components/ui/model-picker-row'
Exampletsx
'use client'

import { useState } from 'react'
import { ModelPickerRow } from '@/components/ui/model-picker-row'

const MODELS = [
  {
    id: 'haiku',
    name: 'Haiku',
    context: '200k',
    speed: 'fast',
    cost: '$0.25/M',
  },
  {
    id: 'sonnet',
    name: 'Sonnet',
    context: '200k',
    speed: 'balanced',
    cost: '$3/M',
  },
  {
    id: 'opus',
    name: 'Opus',
    context: '200k',
    speed: 'deep',
    cost: '$15/M',
  },
]

export default function ModelPickerRowDemo() {
  const [value, setValue] = useState('sonnet')

  return (
    <div className="mx-auto flex min-h-[360px] w-full max-w-2xl flex-col justify-center px-4 py-16 sm:px-6">
      <div className="rounded-2xl border border-border/60 bg-card p-5 sm:p-6">
        <div className="mb-6">
          <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
            meridian-ops · settings
          </p>
          <p className="mt-2 text-sm leading-relaxed text-muted-foreground">
            Pick the model for the March close recon, context, speed, and cost
            stay visible so the tradeoff is never buried in a menu.
          </p>
        </div>
        <ModelPickerRow
          label="Model"
          models={MODELS}
          value={value}
          onChange={setValue}
        />
      </div>
    </div>
  )
}

API reference

ModelPickerRow accepts the following props.

PropTypeDefaultDescription
models*ModelPickerOption[]2–4 options; mono spec strings render verbatim
value*stringselected model id, fully controlled
onChange(id: string) => voidfires with the clicked option's id
labelstring'Model'mono micro-label naming the group

…plus everything from Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface ModelPickerOption {
  id: string
  name: string
  context?: string
  speed?: string
  cost?: string
}

Frequently asked questions

How do I install the Model Picker Row component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/model-picker-row`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Model Picker Row require?

Model Picker Row uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Model Picker Row to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services