Combobox

A text input that opens a filtered list of options.

EXAMPLEwasm · webgpu

This demo runs the real GPUI component on WebGPU, which this browser does not expose.

Try Chrome or Edge 113+, or Safari 26+. In Firefox, enable dom.webgpu.enabled.

You can also run it natively: cargo run -p showcase combobox

The demo failed to start in this browser.

You can run it natively instead: cargo run -p showcase combobox

Live examples are not supported on most mobile browsers yet — open this page on a desktop or tablet to run the demo.

Recent phones with WebGPU may manage it (downloads ~18 MB):

#Anatomy

Import the component's parts and compose them under its root:

use base_gpui::combobox::{
    ComboboxArrow,
    ComboboxBackdrop,
    ComboboxChip,
    ComboboxChipRemove,
    ComboboxChips,
    ComboboxClear,
    ComboboxCollection,
    ComboboxEmpty,
    ComboboxGroup,
    ComboboxGroupLabel,
    ComboboxIcon,
    ComboboxInput,
    ComboboxInputGroup,
    ComboboxItem,
    ComboboxItemIndicator,
    ComboboxLabel,
    ComboboxList,
    ComboboxPopup,
    ComboboxPortal,
    ComboboxPositioner,
    ComboboxRoot,
    ComboboxSeparator,
    ComboboxStatus,
    ComboboxTrigger,
    ComboboxValue,
};

ComboboxRoot::new()
    .child(
        ComboboxChip::new()
                .child(
                    ComboboxChipRemove::new(),
                ),
    )
    .child(
        ComboboxInputGroup::new()
                .child(
                    ComboboxChips::new(),
                )
                .child(
                    ComboboxClear::new(),
                )
                .child(
                    ComboboxIcon::new(),
                )
                .child(
                    ComboboxInput::new(),
                )
                .child(
                    ComboboxTrigger::new(),
                )
                .child(
                    ComboboxValue::new(),
                ),
    )
    .child(
        ComboboxLabel::new(),
    )
    .child(
        ComboboxPortal::new()
                .child(
                    ComboboxBackdrop::new(),
                )
                .child(
                    ComboboxPositioner::new()
                                .child(
                                    ComboboxArrow::new(),
                                )
                                .child(
                                    ComboboxList::new()
                                                    .child(
                                                        ComboboxCollection::new(/* items: Vec<T> */, 0),
                                                    )
                                                    .child(
                                                        ComboboxGroup::new()
                                                                            .child(
                                                                                ComboboxGroupLabel::new(),
                                                                            )
                                                                            .child(
                                                                                ComboboxItem::new()
                                                                                                        .child(
                                                                                                            ComboboxItemIndicator::new(),
                                                                                                        ),
                                                                            )
                                                                            .child(
                                                                                ComboboxSeparator::new(),
                                                                            ),
                                                    ),
                                )
                                .child(
                                    ComboboxPopup::new()
                                                    .child(
                                                        ComboboxEmpty::new(),
                                                    )
                                                    .child(
                                                        ComboboxStatus::new(),
                                                    ),
                                ),
                ),
    );
The anatomy is a structural overview. Parts with mutually exclusive modes may need separate instances; each part's section below documents its configuration.

#ComboboxRoot

Coordinates the component's state and supplies context to its child parts.

Source

use base_gpui::combobox::ComboboxRoot;

ComboboxRoot::new()
    .id("example-id")
    .name("name")
    .default_value(None)
    .value(None)
    .on_value_change(|/* callback arguments */| { /* handle change */ })
    .multiple(true)
    .default_values(/* default_values: Vec<T> */)
    .values(/* values: Vec<T> */)
    .on_values_change(|/* callback arguments */| { /* handle change */ })
    .default_input_value(/* default_input_value: impl Into<SharedString> */)
    .input_value(/* input_value: impl Into<SharedString> */)
    .on_input_value_change(|/* callback arguments */| { /* handle change */ })
    .default_open(true)
    .open(true)
    .on_open_change(|/* callback arguments */| { /* handle change */ })
    .on_item_highlighted(|/* callback arguments */| { /* handle change */ })
    .disabled(true)
    .read_only(true)
    .required(true)
    .open_on_input_click(true)
    .auto_highlight(/* auto_highlight: ComboboxAutoHighlight */)
    .highlight_item_on_hover(true)
    .loop_focus(true)
    .limit(0)
    .filter(|/* callback arguments */| { /* handle change */ })
    .filter_none()
    .item_to_string_label(|/* callback arguments */| { /* handle change */ })
    .item_to_string_value(|/* callback arguments */| { /* handle change */ })
    .multiple_value_formatter(|/* callback arguments */| { /* handle change */ })
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxRoot with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxChild<T>>) -> Self
  • child: impl Into<ComboboxChild<T>>

Adds one typed child to this part.

.childrenpub fn children(mut self, children: impl IntoIterator<Item = impl Into<ComboboxChild<T>>>,) -> Self
  • children: impl IntoIterator<Item = impl Into<ComboboxChild<T>>>

Adds multiple typed children in iteration order.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.idpub fn id(mut self, id: impl Into<ElementId>) -> Self
  • id: impl Into<ElementId>

Sets the stable GPUI element identity. Use a unique value when multiple instances can appear in the same view.

.namepub fn name(mut self, name: impl Into<SharedString>) -> Self
  • name: impl Into<SharedString>

Sets the form field name used when serializing or submitting the value.

.default_valuepub fn default_value(mut self, default_value: Option<T>) -> Self
  • default_value: Option<T>

Sets the initial value for uncontrolled state. Later user changes are retained by the component.

.valuepub fn value(mut self, value: Option<T>) -> Self
  • value: Option<T>

Sets the current controlled value or the value represented by this part, depending on the part's role.

.on_value_changepub fn on_value_change(mut self, on_value_change: impl Fn(Option<&T>, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static,) -> Self
  • on_value_change: impl Fn(Option<&T>, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static

Registers a callback invoked when value change occurs.

.multiplepub fn multiple(mut self, multiple: bool) -> Self
  • multiple: bool

Controls whether more than one value may be selected at the same time.

.default_valuespub fn default_values(mut self, default_values: Vec<T>) -> Self
  • default_values: Vec<T>

Sets the initial values for uncontrolled state.

.valuespub fn values(mut self, values: Vec<T>) -> Self
  • values: Vec<T>

Sets the values configuration for this part.

.on_values_changepub fn on_values_change(mut self, on_values_change: impl Fn(&[T], &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static,) -> Self
  • on_values_change: impl Fn(&[T], &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static

Registers a callback invoked when values change occurs.

.default_input_valuepub fn default_input_value(mut self, default_input_value: impl Into<SharedString>) -> Self
  • default_input_value: impl Into<SharedString>

Sets the initial input value for uncontrolled state.

.input_valuepub fn input_value(mut self, input_value: impl Into<SharedString>) -> Self
  • input_value: impl Into<SharedString>

Sets the input value configuration for this part.

.on_input_value_changepub fn on_input_value_change(mut self, on_input_value_change: impl Fn(&SharedString, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static,) -> Self
  • on_input_value_change: impl Fn(&SharedString, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static

Registers a callback invoked when input value change occurs.

.default_openpub fn default_open(mut self, default_open: bool) -> Self
  • default_open: bool

Sets the initial open state for an uncontrolled component.

.openpub fn open(mut self, open: bool) -> Self
  • open: bool

Controls whether the component is open.

.on_open_changepub fn on_open_change(mut self, on_open_change: impl Fn(bool, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static,) -> Self
  • on_open_change: impl Fn(bool, &mut ComboboxChangeDetails, &mut Window, &mut App) + 'static

Registers a callback invoked when open change occurs.

.on_item_highlightedpub fn on_item_highlighted(mut self, on_item_highlighted: impl Fn(Option<&T>, &ComboboxItemHighlightDetails, &mut Window, &mut App) + 'static,) -> Self
  • on_item_highlighted: impl Fn(Option<&T>, &ComboboxItemHighlightDetails, &mut Window, &mut App) + 'static

Registers a callback invoked when item highlighted occurs.

.disabledpub fn disabled(mut self, disabled: bool) -> Self
  • disabled: bool

When true, prevents user interaction with this part.

.read_onlypub fn read_only(mut self, read_only: bool) -> Self
  • read_only: bool

When true, allows presentation and focus behavior without permitting value changes.

.requiredpub fn required(mut self, required: bool) -> Self
  • required: bool

Marks the control as required for validation and accessibility state.

.open_on_input_clickpub fn open_on_input_click(mut self, open_on_input_click: bool) -> Self
  • open_on_input_click: bool

Controls whether open on input click behavior is enabled.

.auto_highlightpub fn auto_highlight(mut self, auto_highlight: ComboboxAutoHighlight) -> Self
  • auto_highlight: ComboboxAutoHighlight

Controls whether auto highlight behavior is enabled.

.highlight_item_on_hoverpub fn highlight_item_on_hover(mut self, highlight_item_on_hover: bool) -> Self
  • highlight_item_on_hover: bool

Controls whether highlight item on hover behavior is enabled.

.loop_focuspub fn loop_focus(mut self, loop_focus: bool) -> Self
  • loop_focus: bool

Controls whether keyboard focus wraps from the last enabled item to the first and vice versa.

.limitpub fn limit(mut self, limit: usize) -> Self
  • limit: usize

Sets the limit configuration for this part.

.filterpub fn filter(mut self, filter: impl Fn(&T, Option<&SharedString>, &str) -> bool + 'static,) -> Self
  • filter: impl Fn(&T, Option<&SharedString>, &str) -> bool + 'static,

Custom filter replacing the default case-insensitive contains match.

.filter_nonepub fn filter_none(mut self) -> Self

Disables internal filtering for externally filtered lists.

.item_to_string_labelpub fn item_to_string_label(mut self, resolver: impl Fn(&T) -> SharedString + 'static) -> Self
  • resolver: impl Fn(&T) -> SharedString + 'static

Sets the item to string label configuration for this part.

.item_to_string_valuepub fn item_to_string_value(mut self, serializer: impl Fn(&T) -> SharedString + 'static,) -> Self
  • serializer: impl Fn(&T) -> SharedString + 'static,

Sets the item to string value configuration for this part.

.multiple_value_formatterpub fn multiple_value_formatter(mut self, formatter: impl Fn(&[SharedString], &[T]) -> SharedString + 'static,) -> Self
  • formatter: impl Fn(&[SharedString], &[T]) -> SharedString + 'static,

Sets the multiple value formatter configuration for this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxRootStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxRootStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxRoot also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxTrigger

Interactive control that opens, closes, or activates the component.

Source

use base_gpui::combobox::ComboboxTrigger;

ComboboxTrigger::new()
    .id("example-id")
    .disabled(true)
    .aria_label("label")
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxTrigger with its default configuration.

.idpub fn id(mut self, id: impl Into<ElementId>) -> Self
  • id: impl Into<ElementId>

Sets the stable GPUI element identity. Use a unique value when multiple instances can appear in the same view.

.disabledpub fn disabled(mut self, disabled: bool) -> Self
  • disabled: bool

When true, prevents user interaction with this part.

.aria_labelpub fn aria_label(mut self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Accessible label for the trigger button (e.g. "Open suggestions").

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxTriggerStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxTriggerStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxTrigger also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxPortal

Hosts overlay content outside the normal child layout.

Source

use base_gpui::combobox::ComboboxPortal;

ComboboxPortal::new()
    .force_mounted(true)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxPortal with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxPortalChild<T>>) -> Self
  • child: impl Into<ComboboxPortalChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.force_mountedpub fn force_mounted(mut self, force_mounted: bool) -> Self
  • force_mounted: bool

Controls whether force mounted behavior is enabled.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxPortalStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxPortalStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxPortal also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxPositioner

Measures the anchor and positions floating content.

Source

use base_gpui::combobox::ComboboxPositioner;

ComboboxPositioner::new()
    .anchor(/* anchor: Bounds<Pixels> */)
    .side("example-id")
    .align(/* align: ComboboxAlign */)
    .side_offset("example-id")
    .align_offset(/* align_offset: Pixels */)
    .collision_padding(/* collision_padding: Pixels */)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxPositioner with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxPositionerChild<T>>) -> Self
  • child: impl Into<ComboboxPositionerChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.anchorpub fn anchor(mut self, anchor: Bounds<Pixels>) -> Self
  • anchor: Bounds<Pixels>

Explicit anchor override; defaults to input-group-else-input.

.sidepub fn side(mut self, side: ComboboxSide) -> Self
  • side: ComboboxSide

Sets the preferred side of the anchor on which floating content appears.

.alignpub fn align(mut self, align: ComboboxAlign) -> Self
  • align: ComboboxAlign

Sets floating content alignment along the selected side.

.side_offsetpub fn side_offset(mut self, side_offset: Pixels) -> Self
  • side_offset: Pixels

Sets the distance between floating content and its anchor.

.align_offsetpub fn align_offset(mut self, align_offset: Pixels) -> Self
  • align_offset: Pixels

Offsets floating content along its alignment axis.

.collision_paddingpub fn collision_padding(mut self, collision_padding: Pixels) -> Self
  • collision_padding: Pixels

Sets the minimum space retained between floating content and viewport edges.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxPositionerStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxPositionerStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxPositioner also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxPopup

Contains the floating interactive content.

Source

use base_gpui::combobox::ComboboxPopup;

ComboboxPopup::new()
    .side("example-id")
    .align(/* align: ComboboxAlign */)
    .force_mounted(true)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxPopup with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxPopupChild<T>>) -> Self
  • child: impl Into<ComboboxPopupChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.sidepub fn side(mut self, side: ComboboxSide) -> Self
  • side: ComboboxSide

Sets the preferred side of the anchor on which floating content appears.

.alignpub fn align(mut self, align: ComboboxAlign) -> Self
  • align: ComboboxAlign

Sets floating content alignment along the selected side.

.force_mountedpub fn force_mounted(mut self, force_mounted: bool) -> Self
  • force_mounted: bool

Controls whether force mounted behavior is enabled.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxPopupStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxPopupStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxPopup also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxArrow

Optional arrow that visually points toward the overlay anchor.

Source

use base_gpui::combobox::ComboboxArrow;

ComboboxArrow::new()
    .side("example-id")
    .align(/* align: ComboboxAlign */)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxArrow with its default configuration.

.sidepub fn side(mut self, side: ComboboxSide) -> Self
  • side: ComboboxSide

Sets the preferred side of the anchor on which floating content appears.

.alignpub fn align(mut self, align: ComboboxAlign) -> Self
  • align: ComboboxAlign

Sets floating content alignment along the selected side.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxArrowStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxArrowStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxArrow also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxBackdrop

Covers content behind a modal overlay and handles outside interaction.

Source

use base_gpui::combobox::ComboboxBackdrop;

ComboboxBackdrop::new()
    .force_mounted(true)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxBackdrop with its default configuration.

.force_mountedpub fn force_mounted(mut self, force_mounted: bool) -> Self
  • force_mounted: bool

Controls whether force mounted behavior is enabled.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxBackdropStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxBackdropStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxBackdrop also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxChip

Public renderable part of the Combobox Chip component.

Source

use base_gpui::combobox::ComboboxChip;

ComboboxChip::new()
    .index(0)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxChip with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxChipChild<T>>) -> Self
  • child: impl Into<ComboboxChipChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.indexpub fn index(mut self, index: usize) -> Self
  • index: usize

Selection-order position of this chip; assigned by ComboboxChips.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxChipStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxChipStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxChip also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxChipRemove

Public renderable part of the Combobox Chip Remove component.

Source

use base_gpui::combobox::ComboboxChipRemove;

ComboboxChipRemove::new()
    .index(0)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxChipRemove with its default configuration.

.indexpub fn index(mut self, index: usize) -> Self
  • index: usize

Selection-order position of the owning chip; assigned by ComboboxChip.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxChipRemoveStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxChipRemoveStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxChipRemove also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxChips

Public renderable part of the Combobox Chips component.

Source

use base_gpui::combobox::ComboboxChips;

ComboboxChips::new()
    .chip_builder(0)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxChips with its default configuration.

.chip_builderpub fn chip_builder(mut self, builder: impl Fn(&T, usize) -> ComboboxChip<T> + 'static,) -> Self
  • builder: impl Fn(&T, usize) -> ComboboxChip<T> + 'static,

Sets the chip builder configuration for this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxChipsStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxChipsStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxChips also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxClear

Public renderable part of the Combobox Clear component.

Source

use base_gpui::combobox::ComboboxClear;

ComboboxClear::new()
    .id("example-id")
    .keep_mounted(true)
    .aria_label("label")
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxClear with its default configuration.

.idpub fn id(mut self, id: impl Into<ElementId>) -> Self
  • id: impl Into<ElementId>

Sets the stable GPUI element identity. Use a unique value when multiple instances can appear in the same view.

.keep_mountedpub fn keep_mounted(mut self, keep_mounted: bool) -> Self
  • keep_mounted: bool

Keeps the part mounted when inactive or closed so child state can be preserved.

.aria_labelpub fn aria_label(mut self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Accessible label for the clear button; defaults to "Clear".

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxClearStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxClearStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxClear also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxCollection

Public renderable part of the Combobox Collection component.

Source

use base_gpui::combobox::ComboboxCollection;

ComboboxCollection::new();

#Builders

BuilderSignature & description
.newpub fn new(items: Vec<T>, builder: impl Fn(&T, usize) -> ComboboxItem<T> + 'static) -> Self
  • items: Vec<T>
  • builder: impl Fn(&T, usize) -> ComboboxItem<T> + 'static

Creates a ComboboxCollection with its default configuration.

ComboboxCollection also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxEmpty

Public renderable part of the Combobox Empty component.

Source

use base_gpui::combobox::ComboboxEmpty;

ComboboxEmpty::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxEmpty with its default configuration.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxEmptyStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxEmptyStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxEmpty also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxGroup

Groups related child parts and coordinates their shared behavior.

Source

use base_gpui::combobox::ComboboxGroup;

ComboboxGroup::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxGroup with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxGroupChild<T>>) -> Self
  • child: impl Into<ComboboxGroupChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxGroupStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxGroupStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxGroup also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxGroupLabel

Provides a visible label and associated accessibility semantics.

Source

use base_gpui::combobox::ComboboxGroupLabel;

ComboboxGroupLabel::new()
    .label("label")
    .text("label")
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxGroupLabel with its default configuration.

.labelpub fn label(mut self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Sets the label configuration for this part.

.textpub fn text(self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Sets the text configuration for this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxGroupLabelStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxGroupLabelStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxGroupLabel also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxIcon

Optional visual icon for the component.

Source

use base_gpui::combobox::ComboboxIcon;

ComboboxIcon::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxIcon with its default configuration.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxIconStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxIconStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxIcon also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxInput

Text input integrated with the component's state and behavior.

Source

use base_gpui::combobox::ComboboxInput;

ComboboxInput::new()
    .id("example-id")
    .placeholder("placeholder")
    .aria_label("label")
    .disabled(true)
    .style_with_state(|/* callback arguments */| { /* handle change */ })
    .input_style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxInput with its default configuration.

.idpub fn id(mut self, id: impl Into<ElementId>) -> Self
  • id: impl Into<ElementId>

Sets the stable GPUI element identity. Use a unique value when multiple instances can appear in the same view.

.placeholderpub fn placeholder(mut self, placeholder: impl Into<SharedString>) -> Self
  • placeholder: impl Into<SharedString>

Sets the content shown when the component has no current value.

.aria_labelpub fn aria_label(mut self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Accessible label for the combobox reference node; substitutes for Base UI's aria-labelledby wiring, which has no gpui builder.

.disabledpub fn disabled(mut self, disabled: bool) -> Self
  • disabled: bool

When true, prevents user interaction with this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxInputStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxInputStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

.input_style_with_statepub fn input_style_with_state(mut self, style: impl Fn(InputStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(InputStyleState, Div) -> Div + 'static,

Styling hook for the inner input primitive; composes with, not replaces, the Combobox-level style_with_state.

ComboboxInput also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxInputGroup

Groups related child parts and coordinates their shared behavior.

Source

use base_gpui::combobox::ComboboxInputGroup;

ComboboxInputGroup::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxInputGroup with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxInputGroupChild<T>>) -> Self
  • child: impl Into<ComboboxInputGroupChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxInputGroupStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxInputGroupStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxInputGroup also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxItem

Represents one interactive item in the component's collection.

Source

use base_gpui::combobox::ComboboxItem;

ComboboxItem::new()
    .id("example-id")
    .value(/* value: T */)
    .label("label")
    .disabled(true)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxItem with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxItemChild<T>>) -> Self
  • child: impl Into<ComboboxItemChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.idpub fn id(mut self, id: impl Into<ElementId>) -> Self
  • id: impl Into<ElementId>

Sets the stable GPUI element identity. Use a unique value when multiple instances can appear in the same view.

.valuepub fn value(mut self, value: T) -> Self
  • value: T

Sets the current controlled value or the value represented by this part, depending on the part's role.

.labelpub fn label(mut self, label: impl Into<SharedString>) -> Self
  • label: impl Into<SharedString>

Label used for display and filtering.

.disabledpub fn disabled(mut self, disabled: bool) -> Self
  • disabled: bool

When true, prevents user interaction with this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxItemStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxItemStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxItem also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxItemIndicator

Visual indicator for an item's selected or checked state.

Source

use base_gpui::combobox::ComboboxItemIndicator;

ComboboxItemIndicator::new()
    .keep_mounted(true)
    .with_item_state(/* state: ComboboxItemStyleState<T> */)
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxItemIndicator with its default configuration.

.keep_mountedpub fn keep_mounted(mut self, keep_mounted: bool) -> Self
  • keep_mounted: bool

Keeps the part mounted when inactive or closed so child state can be preserved.

.with_item_statepub fn with_item_state(mut self, state: ComboboxItemStyleState<T>) -> Self
  • state: ComboboxItemStyleState<T>

Sets the with item state configuration for this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxItemIndicatorStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxItemIndicatorStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxItemIndicator also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxLabel

Provides a visible label and associated accessibility semantics.

Source

use base_gpui::combobox::ComboboxLabel;

ComboboxLabel::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxLabel with its default configuration.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxLabelStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxLabelStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxLabel also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxList

Contains and coordinates the component's collection items.

Source

use base_gpui::combobox::ComboboxList;

ComboboxList::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxList with its default configuration.

.childpub fn child(mut self, child: impl Into<ComboboxListChild<T>>) -> Self
  • child: impl Into<ComboboxListChild<T>>

Adds one typed child to this part.

.child_anypub fn child_any(mut self, child: impl IntoElement) -> Self
  • child: impl IntoElement

Adds one arbitrary renderable child to this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxListStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxListStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxList also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxSeparator

Visual separator between neighboring items or groups.

Source

use base_gpui::combobox::ComboboxSeparator;

ComboboxSeparator::new()
    .orientation(/* orientation: SeparatorOrientation */)
    .horizontal()
    .vertical()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxSeparator with its default configuration.

.orientationpub fn orientation(mut self, orientation: SeparatorOrientation) -> Self
  • orientation: SeparatorOrientation

Sets the component's horizontal or vertical orientation and corresponding keyboard behavior.

.horizontalpub fn horizontal(self) -> Self

Sets the horizontal configuration for this part.

.verticalpub fn vertical(self) -> Self

Sets the vertical configuration for this part.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(SeparatorStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(SeparatorStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxSeparator also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxStatus

Public renderable part of the Combobox Status component.

Source

use base_gpui::combobox::ComboboxStatus;

ComboboxStatus::new()
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxStatus with its default configuration.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxStatusStyleState, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxStatusStyleState, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxStatus also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#ComboboxValue

Displays or edits the component's current value.

Source

use base_gpui::combobox::ComboboxValue;

ComboboxValue::new()
    .placeholder("placeholder")
    .formatter(|/* callback arguments */| { /* handle change */ })
    .style_with_state(|/* callback arguments */| { /* handle change */ });

#Builders

BuilderSignature & description
.newpub fn new() -> Self

Creates a ComboboxValue with its default configuration.

.placeholderpub fn placeholder(mut self, placeholder: impl Into<SharedString>) -> Self
  • placeholder: impl Into<SharedString>

Sets the content shown when the component has no current value.

.formatterpub fn formatter(mut self, formatter: impl Fn(&ComboboxValueStyleState<T>) -> SharedString + 'static,) -> Self
  • formatter: impl Fn(&ComboboxValueStyleState<T>) -> SharedString + 'static,

Rust-native formatter closure over the current selection.

.style_with_statepub fn style_with_state(mut self, style: impl Fn(ComboboxValueStyleState<T>, Div) -> Div + 'static,) -> Self
  • style: impl Fn(ComboboxValueStyleState<T>, Div) -> Div + 'static,

Styles the part from its current behavioral state while preserving separation between behavior and visual design.

ComboboxValue also supports the GPUI traits implemented in its source, such as standard styling or child composition.

#Accessibility

Keyboard interaction and accessibility semantics are implemented by the component, independently of visual styling. Known limitations caused by missing GPUI accessibility primitives are documented in the module source and are not silently approximated.

Roles/aria props and a11y actions are wired per the port issue's follow-up plan. The following Base UI ARIA attributes have no gpui builder in the pinned revision and are intentionally omitted:

#Stability

Base GPUI is pre-1.0. Builder names and state types may evolve as GPUI and this port mature.