ComboBox Control

Styles

Style Key Semantic Alias IsDefaultStyle*
MaterialComboBoxItemStyle ComboBoxItemStyle
MaterialComboBoxStyle ComboBoxStyle True
MaterialDefaultComboBoxStyle True

IsDefaultStyle*: Styles in this column will be set as the default implicit style for the matching control

Lightweight Styling

Theme-agnostic

Key Type Value
ComboBoxDownArrowPathData String M0 0L5 5L10 0H0Z
ComboBoxUpArrowPathData String M0 0L-5 -5L-10 0H0Z

Themed

Key Type Light
ComboBoxArrowForeground SolidColorBrush OnSurfaceVariantBrush
ComboBoxArrowForegroundOpened SolidColorBrush OnSurfaceVariantBrush
ComboBoxBackground SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundFocused SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundFocusedPressed SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundPointerOver SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundPressed SolidColorBrush SystemControlTransparentBrush
ComboBoxBackgroundUnfocused SolidColorBrush SystemControlTransparentBrush
ComboBoxBorderBrush SolidColorBrush OutlineBrush
ComboBoxBorderBrushDisabled SolidColorBrush OnSurfaceDisabledBrush
ComboBoxBorderBrushOpened SolidColorBrush PrimaryBrush
ComboBoxBorderBrushPointerOver SolidColorBrush OnSurfaceBrush
ComboBoxBorderBrushPressed SolidColorBrush OnSurfaceBrush
ComboBoxBorderThickness Thickness 1
ComboBoxCornerRadius CornerRadius Radius100CornerRadius
ComboBoxDownGlyphHeight Double 5
ComboBoxDownGlyphMargin Thickness 7,0
ComboBoxDownGlyphWidth Double 10
ComboBoxDropDownBackground SolidColorBrush SurfaceBrush
ComboBoxDropDownBackgroundFocused SolidColorBrush SurfaceBrush
ComboBoxDropDownBackgroundFocusedPressed SolidColorBrush SurfaceBrush
ComboBoxDropDownBackgroundPointerOver SolidColorBrush SurfaceBrush
ComboBoxDropDownBackgroundPointerPressed SolidColorBrush SurfaceBrush
ComboBoxDropDownBackgroundPressed SolidColorBrush SurfaceBrush
ComboBoxDropDownBorderBrush SolidColorBrush SystemControlTransparentBrush
ComboBoxDropDownForeground SolidColorBrush SystemControlTransparentBrush
ComboBoxDropDownGlyphForeground SolidColorBrush SystemControlTransparentBrush
ComboBoxDropDownGlyphForegroundDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxDropDownGlyphForegroundFocused SolidColorBrush SystemControlTransparentBrush
ComboBoxDropDownGlyphForegroundFocusedPressed SolidColorBrush SystemControlTransparentBrush
ComboBoxEditableDropDownGlyphForeground SolidColorBrush SystemControlTransparentBrush
ComboBoxForeground SolidColorBrush OnSurfaceBrush
ComboBoxForegroundDisabled SolidColorBrush OnSurfaceLowBrush
ComboBoxForegroundFocused SolidColorBrush OnSurfaceBrush
ComboBoxForegroundFocusedPressed SolidColorBrush OnSurfaceBrush
ComboBoxForegroundPointerOver SolidColorBrush OnSurfaceBrush
ComboBoxForegroundPressed SolidColorBrush OnSurfaceBrush
ComboBoxHeight Double 50
ComboBoxItemBackground SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBackgroundDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBackgroundPointerOver SolidColorBrush OnSurfaceVariantHoverBrush
ComboBoxItemBackgroundPressed SolidColorBrush OnSurfaceVariantHoverBrush
ComboBoxItemBackgroundSelected SolidColorBrush PrimarySelectedBrush
ComboBoxItemBackgroundSelectedDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBackgroundSelectedPointerOver SolidColorBrush PrimarySelectedBrush
ComboBoxItemBackgroundSelectedPressed SolidColorBrush PrimarySelectedBrush
ComboBoxItemBackgroundSelectedUnfocused SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrush SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushPointerOver SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushPressed SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushSelected SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushSelectedDisabled SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushSelectedPointerOver SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushSelectedPressed SolidColorBrush SystemControlTransparentBrush
ComboBoxItemBorderBrushSelectedUnfocused SolidColorBrush SystemControlTransparentBrush
ComboBoxItemForeground SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundDisabled SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundPointerOver SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundPressed SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundSelected SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundSelectedDisabled SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundSelectedPointerOver SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundSelectedPressed SolidColorBrush OnSurfaceBrush
ComboBoxItemForegroundSelectedUnfocused SolidColorBrush OnSurfaceBrush
ComboBoxItemPillFillBrush SolidColorBrush SystemControlTransparentBrush
ComboBoxLeadingIconForeground SolidColorBrush OnSurfaceVariantBrush
ComboBoxLeadingIconForegroundDisabled SolidColorBrush OnSurfaceLowBrush
ComboBoxLeadingIconMargin Thickness 2,0,18,0
ComboBoxLeadingIconWidth Double 20
ComboBoxMinHeight Double 56
ComboBoxOpenedBorderThickness Thickness 2
ComboBoxPadding Thickness Space200HorizontalThickness
ComboBoxPlaceHolderForeground SolidColorBrush OnSurfaceVariantBrush
ComboBoxPlaceHolderForegroundDisabled SolidColorBrush OnSurfaceLowBrush
ComboBoxPlaceHolderForegroundFocused SolidColorBrush OnSurfaceVariantBrush
ComboBoxPlaceHolderForegroundFocusedPressed SolidColorBrush OnSurfaceVariantBrush
ComboBoxPlaceHolderForegroundPointerOver SolidColorBrush OnSurfaceVariantBrush
ComboBoxPlaceHolderForegroundPressed SolidColorBrush OnSurfaceVariantBrush
ComboBoxPlaceholderTextStyle Style MaterialBodyLarge
ComboBoxUpGlyphHeight Double 5
ComboBoxUpGlyphMargin Thickness 7,0
ComboBoxUpGlyphWidth Double 10
ComboBoxUpperPlaceHolderForeground SolidColorBrush OnSurfaceVariantBrush
ComboBoxUpperPlaceHolderForegroundDisabled SolidColorBrush OnSurfaceLowBrush
ComboBoxUpperPlaceHolderForegroundFocused SolidColorBrush PrimaryBrush
ComboBoxUpperPlaceHolderForegroundFocusedPressed SolidColorBrush PrimaryBrush
ComboBoxUpperPlaceHolderForegroundOpened SolidColorBrush PrimaryBrush
ComboBoxUpperPlaceHolderForegroundPointerOver SolidColorBrush OnSurfaceVariantBrush
ComboBoxUpperPlaceHolderForegroundPressed SolidColorBrush OnSurfaceVariantBrush
ComboBoxUpperPlaceHolderMargin Thickness 0
ComboBoxUpperPlaceHolderScaleX Double 0.7
ComboBoxUpperPlaceHolderScaleY Double 0.7
ComboBoxUpperPlaceHolderTranslateY Double -11

The Dark theme uses the same values as Light.

Placeholder

Once an item is selected, the Material ComboBox keeps its placeholder visible as a floating label: a scaled-down copy shown above the selected value. These keys apply to the Material style only:

  • ComboBoxUpperPlaceHolderScaleX, ComboBoxUpperPlaceHolderScaleY and ComboBoxUpperPlaceHolderTranslateY size and position the floating label.
  • ComboBoxUpperPlaceHolderMargin offsets the floating label within the field. The label is centered in the same area as the selected value, so this moves the label only; the selected value keeps its fixed offset below it.
  • ComboBoxPlaceholderTextStyle is the text style of both the placeholder and the floating label. It must target TextBlock. The template sets Foreground on both and Margin on the floating label, so those setters in this style have no effect; use the ComboBoxPlaceHolderForeground*, ComboBoxUpperPlaceHolderForeground* and ComboBoxUpperPlaceHolderMargin keys instead.
Note

On Uno Platform targets, the ScaleX, ScaleY and TranslateY keys are looked up again from the application resources when the app theme changes at runtime. Overrides declared in App.xaml are kept, but overrides declared on a page or on the ComboBox itself revert to the defaults after a theme change. The Margin and text-style keys are not affected. See unoplatform/uno#24958.

<ComboBox PlaceholderText="Label">
    <ComboBox.Resources>
        <x:Double x:Key="ComboBoxUpperPlaceHolderScaleX">0.6</x:Double>
        <x:Double x:Key="ComboBoxUpperPlaceHolderScaleY">0.6</x:Double>
        <x:Double x:Key="ComboBoxUpperPlaceHolderTranslateY">-13</x:Double>
        <Thickness x:Key="ComboBoxUpperPlaceHolderMargin">0,0,0,2</Thickness>
        <StaticResource x:Key="ComboBoxPlaceholderTextStyle" ResourceKey="BodyMedium" />
    </ComboBox.Resources>
</ComboBox>