Combobox

A pill input with a filtered list: matches highlighted, async results, chips for many, create.

View source
import { Combobox } from "@logicplanes/kaeso-ui";

Props

  • aria-label
    string

    The accessible name, for when there is no visible label.

  • defaultValue
    string | string[] | null

    The value on first render, when the component keeps its own value.

  • description
    ReactNode

    One sentence of help under the label.

  • disabled
    boolean

    Turns it off: it can't be used, and it looks dimmed.

  • emptyText
    ReactNode

    What the empty list says: "No models match". Defaults to "No results" in the provider's language.

  • id
    string

    The id of the control, so a label elsewhere can point to it.

  • invalid
    boolean

    Shows it as invalid; pair it with a message that says what to fix.

  • label
    ReactNode

    The visible label.

  • layout
    "horizontal" | "vertical"

    The label above the control (vertical) or beside it (horizontal).

  • loading
    boolean

    Shows a quiet progress line at the top of the list (async results).

  • multiple
    boolean

    Allows choosing more than one option; value is then a list.

  • name
    string

    The field name the value is sent under in a form.

  • onCreate
    ((label: string) => void)

    Offers "Create “…”" when nothing matches exactly.

  • onInputValueChange
    ((value: string) => void)

    Called with the text typed into the input.

  • onValueChange
    ((value: string | null) => void) | ((value: string[]) => void)

    Called with the chosen value, or the list of values with multiple.

  • optional
    boolean

    Adds “Optional” to the label, for forms where most fields are required.

  • options
    ComboboxOption[]

    The options to choose from.

  • placeholder
    string

    Text shown while there is no value.

  • required
    boolean

    Marks it as required in a form.

  • size
    "md" | "sm" | "lg" | "xl"

    The height of the input.

  • value
    string | string[] | null

    The chosen value, or a list of values with multiple, when you control it.