Props for the custom Autocomplete component.

interface AutocompleteProps {
    background?:
        | "primary"
        | "blue5"
        | "white"
        | "textFaded"
        | "navigation"
        | "navigationTop"
        | "navigationSide"
        | "background"
        | "drawer"
        | "cards"
        | "cardDivider"
        | "cardSectionSeparator"
        | "fieldsOnCard"
        | "fieldsFloating"
        | "buttonSecondary"
        | "iconsDisabled"
        | "red"
        | "orange"
        | "greenDark"
        | "greenLight"
        | "text"
        | "redDark"
        | "orangeDark"
        | "greenDark2"
        | "blueDark"
        | "lineColor"
        | "iconButtonBg";
    backgroundColor?: string;
    badgeSelectedCount?: boolean;
    clearable?: boolean;
    defaultValue?: string
    | string[]
    | DropdownOption
    | DropdownOption[];
    inputLabel?: string;
    isNarrow?: boolean;
    labelColor?: string;
    noDropIcon?: boolean;
    onChange?: (value: null | string | string[]) => void;
    onClear?: () => void;
    options: DropdownOption[];
    required?: boolean;
    selectedColor?:
        | "primary"
        | "blue5"
        | "white"
        | "textFaded"
        | "navigation"
        | "navigationTop"
        | "navigationSide"
        | "background"
        | "drawer"
        | "cards"
        | "cardDivider"
        | "cardSectionSeparator"
        | "fieldsOnCard"
        | "fieldsFloating"
        | "buttonSecondary"
        | "iconsDisabled"
        | "red"
        | "orange"
        | "greenDark"
        | "greenLight"
        | "text"
        | "redDark"
        | "orangeDark"
        | "greenDark2"
        | "blueDark"
        | "lineColor"
        | "iconButtonBg";
    size?: "small"
    | "medium";
    startLabel?: ReactNode;
    useAllAsDefault?: boolean;
    value?: null | string | string[] | DropdownOption | DropdownOption[];
    width?: string | number;
}

Hierarchy (View Summary)

Properties

background?:
    | "primary"
    | "blue5"
    | "white"
    | "textFaded"
    | "navigation"
    | "navigationTop"
    | "navigationSide"
    | "background"
    | "drawer"
    | "cards"
    | "cardDivider"
    | "cardSectionSeparator"
    | "fieldsOnCard"
    | "fieldsFloating"
    | "buttonSecondary"
    | "iconsDisabled"
    | "red"
    | "orange"
    | "greenDark"
    | "greenLight"
    | "text"
    | "redDark"
    | "orangeDark"
    | "greenDark2"
    | "blueDark"
    | "lineColor"
    | "iconButtonBg"
backgroundColor?: string

Background color (theme-based or custom) for the input field.

badgeSelectedCount?: boolean

Whether to show a badge indicator for selected count (multi-select only).

clearable?: boolean

If true, displays a clear 'X' button.

defaultValue?: string | string[] | DropdownOption | DropdownOption[]

Default value used in uncontrolled mode.

inputLabel?: string

Placeholder text when nothing is selected.

isNarrow?: boolean

If field is narrow.

labelColor?: string

Color name (theme-based) for the startLabel text.

noDropIcon?: boolean

Optional prop to disable the dropdown icon. If true, the dropdown icon will not be displayed.

onChange?: (value: null | string | string[]) => void

Callback triggered when the selection changes.

onClear?: () => void

Callback triggered when the clear 'X' button is clicked. This will be called in addition to the regular onChange with null/empty array.

options: DropdownOption[]

List of dropdown options.

required?: boolean

If field is required.

selectedColor?:
    | "primary"
    | "blue5"
    | "white"
    | "textFaded"
    | "navigation"
    | "navigationTop"
    | "navigationSide"
    | "background"
    | "drawer"
    | "cards"
    | "cardDivider"
    | "cardSectionSeparator"
    | "fieldsOnCard"
    | "fieldsFloating"
    | "buttonSecondary"
    | "iconsDisabled"
    | "red"
    | "orange"
    | "greenDark"
    | "greenLight"
    | "text"
    | "redDark"
    | "orangeDark"
    | "greenDark2"
    | "blueDark"
    | "lineColor"
    | "iconButtonBg"

Optional color for the selected label text.

size?: "small" | "medium"

Size of the input (small or medium).

startLabel?: ReactNode

A label to render before the field (outside the input).

useAllAsDefault?: boolean

If true, adds an "All" option and makes it the default selection in multi-select mode.

value?: null | string | string[] | DropdownOption | DropdownOption[]

Controlled value for the input.

width?: string | number

Sets the width of the autocomplete container. If "fullwidth", takes 100%.