murad-sinatra

Combobox

Forms

About

A searchable select field where typing filters a list of options, arrow keys move the highlight, and Enter commits the choice.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Combobox to your project and fits it to your theme.

Code

How Combobox is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import Combobox from "@/components/ui/combobox";

const PLANS = [
  { label: "Solo — 1 seat", value: "solo" },
  { label: "Team — up to 20 seats", value: "team" },
  { label: "Enterprise — unlimited", value: "enterprise" },
  { label: "Legacy (unavailable)", value: "legacy", disabled: true },
];

const COUNTRIES = [
  "Argentina",
  "Australia",
  "Austria",
  "Belgium",
  "Brazil",
  "Canada",
  "Chile",
  "China",
  "Colombia",
  "Czechia",
  "Denmark",
  "Egypt",
  "Estonia",
  "Finland",
  "France",
  "Germany",
  "Ghana",
  "Greece",
  "Hungary",
  "Iceland",
  "India",
  "Indonesia",
  "Ireland",
  "Israel",
  "Italy",
  "Japan",
  "Kenya",
  "Latvia",
  "Lithuania",
  "Mexico",
  "Netherlands",
  "New Zealand",
  "Nigeria",
  "Norway",
  "Poland",
  "Portugal",
  "Singapore",
  "South Korea",
  "Spain",
  "Sweden",
  "Switzerland",
  "United Kingdom",
  "United States",
  "Vietnam",
].map((label) => ({ label, value: label.toLowerCase().replace(/\s+/g, "-") }));

export default function ComboboxDemo() {
  return (
    <div
      className="mors-scope w-full max-w-xl grid grid-cols-1 sm:grid-cols-2 gap-6 p-6"
      style={{
        background: "var(--mors-color-canvas)",
        color: "var(--mors-color-text)",
      }}
    >
      <Combobox
        label="Country"
        options={COUNTRIES}
        placeholder="Search countries"
      />
      <Combobox label="Plan" options={PLANS} defaultValue="team" />
    </div>
  );
}

More by murad-sinatra

View all
  • Event Calendar

    Event Calendar

    3
  • Table

    Table

    2
  • Command Palette

    Command Palette

    1
  • Drawer

    Drawer

    1
  • Toggles

    Toggles

    1
  • Number Field

    Number Field

    1
  • Tooltip

    Tooltip

  • Popover

    Popover

More in Forms

View all
  • Contact Card

    Contact Card

    1K
  • Premium Auth

    Premium Auth

    524
  • Book A Demo 1

    Book A Demo 1

    73
  • Login 1

    Login 1

    53
  • Form

    Form

    137
  • Card Studio

    Card Studio

    41
  • SignInPage

    SignInPage

    667
  • Split Sign In Form

    Split Sign In Form

    46