DocsGitHub
Getting Started
  • Overview
  • Design Tokens
Components
  • Accordion
  • Alert
  • Announcement
  • Avatar
  • Badge
  • BigCalendar
  • Breadcrumb
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Checkbox
  • Chip
  • CloseButton
  • Combobox
  • CommandPalette
  • ContextMenu
  • Currency
  • DatePicker
  • DescriptionList
  • Drawer
  • DropdownMenu
  • EmptyState
  • Field
  • FileUpload
  • FormGrid
  • Hotkey
  • Icon
  • Input
  • Metric
  • Modal
  • MultiSelect
  • NumberInput
  • Pagination
  • Popover
  • ProgressBar
  • Radio
  • Rating
  • SegmentedControl
  • Select
  • SelectionCard
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Stepper
  • Switch
  • Table
  • Tabs
  • Textarea
  • Timeline
  • TimePicker
  • Toast
  • Tooltip
  • TransferList
  • TreeView
  • Wizard
Charts
  • Overview
  • Area Chart
  • Bar Chart
  • Donut Chart
  • Line Chart
  • Pie Chart
  • Stacked Bar Chart

Combobox

A searchable single-select with virtual focus, local and parent-owned filtering, loading states, and collision-aware positioning.

Installation

tsx
import { Combobox } from "madagent";

const options = [
  { value: "draft", label: "Draft" },
  { value: "approved", label: "Approved" },
];

<Combobox options={options} aria-label="Status" />

Default

Controlled and Clearable

Value: amina

Rich Options

Sizes

Parent-Filtered Async Mode

Loading, Empty, and Disabled

PropTypeDefaultDescription
options*
ComboboxOption[]
-Options with value, label, and optional description, icon, and disabled state.
value
stringnull
-Controlled selected value.
defaultValue
stringnull
nullInitial selected value for uncontrolled usage.
onChange
(value: string | null) => void
-Called when an option is selected or the value is cleared.
query
string
-Controlled text input value.
onQueryChange
(query: string) => void
-Called as the user types. Its presence enables async mode, so the parent owns filtering.
loading
boolean
falseReplaces options with a loading status row.
placeholder
string
"Select an option"Input placeholder shown when there is no value or query.
size
"sm""md""lg"
"md"Controls the input height and text scale.
disabled
boolean
falseDisables typing and opening the listbox.
clearable
boolean
falseShows a small clear button when a value or query is present.
emptyMessage
ReactNode
"No options found"Content rendered when the filtered option list is empty.
filter
(option: ComboboxOption, query: string) => boolean
-Overrides case-insensitive local filtering in synchronous mode.

RTL Support

Components automatically adapt to right-to-left languages using CSS logical properties.

Preview

Usage

tsx
<Combobox
  options={[
    { value: "cairo", label: "القاهرة", description: "المكتب الرئيسي" },
    { value: "riyadh", label: "الرياض", description: "فرع المملكة" },
    { value: "dubai", label: "دبي", description: "مركز التوزيع" },
  ]}
  defaultValue="cairo"
  clearable
  aria-label="المدينة"
/>