Command Palette

Search for a command to run...

GitHub
ComponentsSearch Select

Search Select

A beautiful searchable combobox supporting single/multi selection, custom avatars, description lines, and debounced API searching.

React
Async Debounced

Interactive Demo

Toggle through single, multi-selection, and faked network loading configurations below.

Single Search Select (With Subtexts)

Filters static configurations instantly. Currently selected: manager

Multi-Select Combobox (With Avatars & Badges)

Select multiple assignees. Chips render as closable pills inside the trigger.

Async API Stream (Debounced Search)

Simulates dynamic server requests. Type a Rizal municipality name to see debounced fetching shimmers in action.

Installation

pnpm dlx shadcn@latest add https://micto-ui-kit.misangono.net/r/micto/search-select.json

Static Local Filtering

For localized lists (roles, flags, status items). Loads and filters in client-side memory.

import { useState } from "react"
import { SearchSelect } from "@/components/micto/search-select"

const roles = [
  { value: "admin", label: "Administrator", description: "Full privileges" },
  { value: "editor", label: "Editor", description: "Content privileges" },
]

export default function Page() {
  const [role, setRole] = useState("editor")
  return (
    <SearchSelect 
      options={roles} 
      value={role} 
      onChange={setRole} 
      placeholder="Select a system role"
    />
  )
}

Async Search (Multi-Select assignee style)

Throttles network requests automatically using a 300ms debounce. Ideal for searching deep databases.

import { SearchSelect } from "@/components/micto/search-select"

export default function Page() {
  const handleUserSearch = async (query: string) => {
    const res = await fetch(`/api/users?search=${query}`)
    const users = await res.json()
    return users.map(u => ({
      value: u.id,
      label: u.name,
      description: u.email,
      avatar: u.avatar_url // optional image avatar
    }))
  }

  return (
    <SearchSelect 
      onSearch={handleUserSearch} 
      multiple // enables pill badge multi-select
      placeholder="Assign team members..."
    />
  )
}

API Reference

Configure the component using the following properties.

PropTypeDefaultDescription
optionsSearchSelectOption[][]Static list of options to search and filter locally inside memory.
onSearch(query: string) => Promise<SearchSelectOption[]>undefinedAsync search callback. Triggers on debounced input (300ms) with shimmer states.
valuestring | string[]undefinedCurrently selected value. Passes string in single mode, or string array in multi mode.
onChange(value: any) => voidundefinedCallback triggered when selection state updates.
multiplebooleanfalseWhether to enable multi-selection. Renders closable pills in trigger box.
placeholderstring'Select option...'Empty state text shown in select button.
searchPlaceholderstring'Search...'Placeholder text displayed in popup filter box.
emptyMessagestring'No results found.'Message rendered when search queries find no matching options.
disabledbooleanfalseDisable the entire combobox selection and interactions.