Autocomplete

Free text with suggestions.

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

Props

  • aria-label
    string

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

  • defaultValue
    string

    The text in the input on first render.

  • description
    ReactNode

    One sentence of help under the label.

  • disabled
    boolean

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

  • id
    string

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

  • label
    ReactNode

    The visible label.

  • layout
    "horizontal" | "vertical"

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

  • leadingIcon
    IconSvgElement

    An icon at the start of the input.

  • name
    string

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

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

    Called with the text whenever it changes.

  • optional
    boolean

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

  • 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.

  • suggestions
    string[]

    Suggestions; the value is free text.

  • value
    string

    The text in the input, when you control it.