- Prop
options- Type
readonly ComboboxOption[]- Default
- —
- Requirement
- required
- Description
- —
Docs Components Forms
Combobox
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const comboboxFixture = { id: "combobox", label: "Service", defaultValue: ["ledger-api"], options: [ { value: "ledger-api", label: "ledger-api" }, { value: "ledger-worker", label: "ledger-worker" }, { value: "billing-api", label: "billing-api", disabled: true }, ],} as const; import { Combobox } from "@grassroot/ui-react"; export default function ComboboxDemo() { return ( <div> <Combobox id={comboboxFixture.id} label={comboboxFixture.label} defaultValue={comboboxFixture.defaultValue} options={[...comboboxFixture.options]} /> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { ref } from "vue";const comboboxFixture = { id: "combobox", label: "Service", defaultValue: ["ledger-api"], options: [ { value: "ledger-api", label: "ledger-api" }, { value: "ledger-worker", label: "ledger-worker" }, { value: "billing-api", label: "billing-api", disabled: true }, ],} as const; import { Combobox } from "@grassroot/ui-vue";const value = ref(comboboxFixture.defaultValue);</script><template> <div> <Combobox v-model="value" :label="comboboxFixture.label" :options="[...comboboxFixture.options]" /> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";const comboboxFixture = { id: "combobox", label: "Service", defaultValue: ["ledger-api"], options: [ { value: "ledger-api", label: "ledger-api" }, { value: "ledger-worker", label: "ledger-worker" }, { value: "billing-api", label: "billing-api", disabled: true }, ],} as const; import { GrassrootCombobox } from "@grassroot/ui-angular";@Component({ selector: "app-combobox-demo", standalone: true, imports: [GrassrootCombobox], template: `<div> <grassroot-combobox [label]="fixture.label" [options]="fixture.options" [value]="fixture.defaultValue" /> </div>`,})export class ComboboxDemoComponent { protected readonly fixture = comboboxFixture;}export default ComboboxDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> const comboboxFixture = { id: "combobox", label: "Service", defaultValue: ["ledger-api"], options: [ { value: "ledger-api", label: "ledger-api" }, { value: "ledger-worker", label: "ledger-worker" }, { value: "billing-api", label: "billing-api", disabled: true }, ], } as const; import { Combobox } from "@grassroot/ui-svelte";</script> <div> <Combobox label={comboboxFixture.label} options={[...comboboxFixture.options]} defaultValue={comboboxFixture.defaultValue} /></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */const comboboxFixture = { id: "combobox", label: "Service", defaultValue: ["ledger-api"], options: [ { value: "ledger-api", label: "ledger-api" }, { value: "ledger-worker", label: "ledger-worker" }, { value: "billing-api", label: "billing-api", disabled: true }, ],} as const; import { Combobox } from "@grassroot/ui-solid";export default function ComboboxDemo() { return ( <div> <Combobox label={comboboxFixture.label} options={[...comboboxFixture.options]} defaultValue={comboboxFixture.defaultValue} /> </div> );}Installation
API Reference
Import
import { Combobox } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
Description
optionsreadonly ComboboxOption[]—
required
—
valueComboboxValue | undefined—
optional
—
defaultValueComboboxValue | undefined—
optional
—
selectionMode"single" | "multiple" | undefined—
optional
—
onValueChange((value: ComboboxValue) => void) | undefined—
optional
—
openboolean | undefined—
optional
—
onOpenChange((open: boolean) => void) | undefined—
optional
—
inputValuestring | undefined—
optional
—
defaultInputValuestring | undefined—
optional
—
onInputValueChange((inputValue: string) => void) | undefined—
optional
—
loadOptionsboolean | undefined—
optional
—
runCommandimport("@grassroot/ui-headless-core/combobox").ComboboxRunCommand | undefined—
optional
—
namestring | undefined—
optional
—
requiredboolean | undefined—
optional
—
- Prop
value- Type
ComboboxValue | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultValue- Type
ComboboxValue | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
selectionMode- Type
"single" | "multiple" | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onValueChange- Type
((value: ComboboxValue) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
open- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onOpenChange- Type
((open: boolean) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
inputValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultInputValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onInputValueChange- Type
((inputValue: string) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
loadOptions- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
runCommand- Type
import("@grassroot/ui-headless-core/combobox").ComboboxRunCommand | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
name- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
required- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
"aria-label"- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- Accessible name for trigger when no visible label is rendered.
- Prop
"aria-labelledby"- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- ID of external element labelling the trigger.
- Prop
dir- Type
"ltr" | "rtl" | undefined- Default
- —
- Requirement
- optional
- Description
- Text direction.
- Prop
placeholder- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
searchPlaceholder- Type
string | undefined- Default
"Search…"- Requirement
- optional
- Description
- Placeholder inside filter input.
- Prop
emptyText- Type
string | undefined- Default
"No results"- Requirement
- optional
- Description
- Shown when filter matches nothing.
- Prop
defaultOpen- Type
boolean | undefined- Default
false- Requirement
- optional
- Description
- Render initially open — handy for layout/stories.
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
Events
| Event | Payload |
|---|---|
onValueChange | ((value: ComboboxValue) => void) | undefined |
onOpenChange | ((open: boolean) => void) | undefined |
onInputValueChange | ((inputValue: string) => void) | undefined |
Import
import { ref } from "vue";
import { Combobox } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
optionsreadonly ComboboxOptionInput[]—
required
modelValueComboboxValue | undefined—
optional
defaultValueComboboxValue | undefined—
optional
selectionMode"single" | "multiple" | undefined—
optional
openboolean | undefinedundefinedoptional
inputValuestring | undefined—
optional
defaultInputValuestring | undefined—
optional
loadOptionsboolean | undefined—
optional
runCommandComboboxRunCommand | undefined—
optional
namestring | undefined—
optional
requiredboolean | undefined—
optional
labelstring | undefined—
optional
placeholderstring | undefined"Select…"optional
searchPlaceholderstring | undefined"Search…"optional
- Prop
options- Type
readonly ComboboxOptionInput[]- Default
- —
- Requirement
- required
- Prop
modelValue- Type
ComboboxValue | undefined- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
ComboboxValue | undefined- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
"single" | "multiple" | undefined- Default
- —
- Requirement
- optional
- Prop
open- Type
boolean | undefined- Default
undefined- Requirement
- optional
- Prop
inputValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
defaultInputValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
loadOptions- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Prop
runCommand- Type
ComboboxRunCommand | undefined- Default
- —
- Requirement
- optional
- Prop
name- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string | undefined- Default
"Select…"- Requirement
- optional
- Prop
searchPlaceholder- Type
string | undefined- Default
"Search…"- Requirement
- optional
- Prop
emptyText- Type
string | undefined- Default
"No results"- Requirement
- optional
- Prop
defaultOpen- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl" | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
update:modelValue | [value: ComboboxValue] |
update:open | [open: boolean] |
update:inputValue | [value: string] |
Import
import { Component } from "@angular/core";
import { GrassrootCombobox } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
optionsreadonly ComboboxOptionInput[]—
required
labelstring—
optional
placeholderstring"Select…"optional
searchPlaceholderstring"Search…"optional
emptyTextstring"No results"optional
idstring—
optional
"aria-label"stringundefinedoptional
"aria-labelledby"stringundefinedoptional
defaultOpenbooleanfalseoptional
openboolean—
optional
selectionMode"single" | "multiple"—
optional
valueComboboxValue—
optional
defaultValueComboboxValue—
optional
inputValuestring—
optional
- Prop
options- Type
readonly ComboboxOptionInput[]- Default
- —
- Requirement
- required
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Select…"- Requirement
- optional
- Prop
searchPlaceholder- Type
string- Default
"Search…"- Requirement
- optional
- Prop
emptyText- Type
string- Default
"No results"- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
"aria-label"- Type
string- Default
undefined- Requirement
- optional
- Prop
"aria-labelledby"- Type
string- Default
undefined- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
false- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
"single" | "multiple"- Default
- —
- Requirement
- optional
- Prop
value- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
inputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultInputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
loadOptions- Type
boolean- Default
- —
- Requirement
- optional
- Prop
runCommand- Type
ComboboxRunCommand- Default
- —
- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean- Default
false- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
openChange | boolean |
valueChange | ComboboxValue |
inputValueChange | string |
Import
import { Combobox } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
optionsreadonly ComboboxOptionInput[]—
required
valueComboboxValue—
optional
defaultValueComboboxValue—
optional
selectionMode"single" | "multiple"—
optional
labelstring—
optional
placeholderstring"Select…"optional
searchPlaceholderstring"Search…"optional
emptyTextstring"No results"optional
defaultOpenbooleanfalseoptional
openboolean—
optional
inputValuestring—
optional
defaultInputValuestring—
optional
loadOptionsboolean—
optional
namestring—
optional
- Prop
options- Type
readonly ComboboxOptionInput[]- Default
- —
- Requirement
- required
- Prop
value- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
"single" | "multiple"- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Select…"- Requirement
- optional
- Prop
searchPlaceholder- Type
string- Default
"Search…"- Requirement
- optional
- Prop
emptyText- Type
string- Default
"No results"- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
false- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
inputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultInputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
loadOptions- Type
boolean- Default
- —
- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
aria-label- Type
string- Default
- —
- Requirement
- optional
- Prop
aria-labelledby- Type
string- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(value: ComboboxValue) => void- Default
- —
- Requirement
- optional
- Prop
onOpenChange- Type
(open: boolean) => void- Default
- —
- Requirement
- optional
- Prop
onInputValueChange- Type
(inputValue: string) => void- Default
- —
- Requirement
- optional
- Prop
runCommand- Type
UseComboboxOptions["runCommand"]- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (value: ComboboxValue) => void |
onOpenChange | (open: boolean) => void |
onInputValueChange | (inputValue: string) => void |
Import
import { Combobox } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
optionsreadonly ComboboxOptionInput[]—
required
valueComboboxValue—
optional
defaultValueComboboxValue—
optional
selectionMode"single" | "multiple"—
optional
onValueChange(value: ComboboxValue) => void—
optional
openboolean—
optional
onOpenChange(open: boolean) => void—
optional
inputValuestring—
optional
defaultInputValuestring—
optional
onInputValueChange(inputValue: string) => void—
optional
loadOptionsboolean—
optional
runCommandComboboxRunCommand—
optional
namestring—
optional
requiredboolean—
optional
- Prop
options- Type
readonly ComboboxOptionInput[]- Default
- —
- Requirement
- required
- Prop
value- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
ComboboxValue- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
"single" | "multiple"- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(value: ComboboxValue) => void- Default
- —
- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
onOpenChange- Type
(open: boolean) => void- Default
- —
- Requirement
- optional
- Prop
inputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultInputValue- Type
string- Default
- —
- Requirement
- optional
- Prop
onInputValueChange- Type
(inputValue: string) => void- Default
- —
- Requirement
- optional
- Prop
loadOptions- Type
boolean- Default
- —
- Requirement
- optional
- Prop
runCommand- Type
ComboboxRunCommand- Default
- —
- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Select…"- Requirement
- optional
- Prop
searchPlaceholder- Type
string- Default
"Search…"- Requirement
- optional
- Prop
emptyText- Type
string- Default
"No results"- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
aria-label- Type
string- Default
- —
- Requirement
- optional
- Prop
aria-labelledby- Type
string- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (value: ComboboxValue) => void |
onOpenChange | (open: boolean) => void |
onInputValueChange | (inputValue: string) => void |