Props for the Dropdown component.

interface DropdownProps {
    backgroundColor?:
        | "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";
    hideDropdownIcon?: boolean;
    iconLabelOnly?: boolean;
    label: string;
    maxWidth?: number;
    onChange: (value: string) => void;
    options: { label: ReactNode; prependIcon?: ReactNode; value: string }[];
    overrideColor?: string;
    overrideLabel?: ReactNode;
    value: string;
}

Hierarchy

  • Omit<SelectProps, "value" | "onChange">
    • DropdownProps

Properties

backgroundColor?:
    | "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"

backfround color

'transparent'
hideDropdownIcon?: boolean

Hide the dropdown icon. If set to true, the dropdown icon will not be displayed.

false
iconLabelOnly?: boolean

Show icon only in dropdown label This is useful when you want to display only the icon without any text.

false
label: string

The label displayed above the dropdown.

maxWidth?: number

Max width of the dropdown.

413
onChange: (value: string) => void

Function to call when selection changes.

options: { label: ReactNode; prependIcon?: ReactNode; value: string }[]

The list of options to display in the dropdown. The label can now be a string or a custom JSX element.

overrideColor?: string

Optional override color for the text.

overrideLabel?: ReactNode

Show icon only in dropdown label This is useful when you want to display only the icon without any text.

<DropdownIcon />
value: string

The selected value.