Skip to content

Combobox

Combines editable text, filtering, optional chips, and a native suggestion surface.

#Import

Import Combobox from quickgui.

use quickgui::*;

#Usage

let mut state = ComboboxState::new(items);
state.set_query("pro");
div().child(text_input(state.query()))

#Anatomy

  • Combobox::root
  • Combobox::input
  • Combobox::option_part
  • Combobox::label
  • Combobox::value
  • Combobox::icon
  • Combobox::input_group
  • Combobox::clear
  • Combobox::trigger
  • Combobox::chips
  • Combobox::chip
  • Combobox::chip_remove
  • Combobox::backdrop
  • Combobox::portal
  • Combobox::positioner
  • Combobox::popup
  • Combobox::arrow
  • Combobox::status
  • Combobox::empty
  • Combobox::list
  • Combobox::row
  • Combobox::item
  • Combobox::item_indicator
  • Combobox::group
  • Combobox::group_label
  • Combobox::collection
  • Combobox::separator

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

ComboboxState

View source
pub fn new(items: impl IntoIterator<Item = PickerItem<T>>) -> Result<Self, PickerError>
with_layoutpub fn with_layout(mut self, layout: ComboboxPopoverLayout) -> Self—

Configures with layout for this part.

pub fn with_layout(mut self, layout: ComboboxPopoverLayout) -> Self
View source
with_filter_modepub fn with_filter_mode(mut self, mode: PickerFilterMode) -> Self—

Configures with filter mode for this part.

pub fn with_filter_mode(mut self, mode: PickerFilterMode) -> Self
View source
with_selected_sourcepub fn with_selected_source(mut self, source_index: usize) -> Self—

Set an initial selection before a runtime context exists.

pub fn with_selected_source(mut self, source_index: usize) -> Self
View source
with_selected_idpub fn with_selected_id(mut self, id: impl Into<ElementId>) -> Self—

Set an initial stable-ID selection before a runtime context exists.

pub fn with_selected_id(mut self, id: impl Into<ElementId>) -> Self
View source
layoutpub const fn layout(&self) -> ComboboxPopoverLayout—

Configures layout for this part.

pub const fn layout(&self) -> ComboboxPopoverLayout
View source
set_layoutpub fn set_layout(&mut self, layout: ComboboxPopoverLayout, cx: &mut EventContext) -> bool—

Replace popover geometry and synchronously dismiss an obsolete fixed-size child.

pub fn set_layout(&mut self, layout: ComboboxPopoverLayout, cx: &mut EventContext) -> bool
View source
itemspub fn items(&self) -> &[PickerItem<T>]—

Configures items for this part.

pub fn items(&self) -> &[PickerItem<T>]
View source
set_itemspub fn set_items( &mut self, items: impl IntoIterator<Item = PickerItem<T>>, cx: &mut EventContext, ) -> Result<(), PickerError>—

Atomically replace the bounded suggestion source. A committed item with a stable ID is rebound across filtering or reordering. If it is temporarily absent, its cloned committed value and label remain authoritative while its current source index becomes `None`.

pub fn set_items( &mut self, items: impl IntoIterator<Item = PickerItem<T>>, cx: &mut EventContext, ) -> Result<(), PickerError>
View source
filter_modepub const fn filter_mode(&self) -> PickerFilterMode—

Configures filter mode for this part.

pub const fn filter_mode(&self) -> PickerFilterMode
View source
set_filter_modepub fn set_filter_mode(&mut self, mode: PickerFilterMode, cx: &mut EventContext) -> bool—

Configures set filter mode for this part.

pub fn set_filter_mode(&mut self, mode: PickerFilterMode, cx: &mut EventContext) -> bool
View source
querypub fn query(&self) -> &Arc<str>—

Configures query for this part.

pub fn query(&self) -> &Arc<str>
View source
input_valuepub fn input_value(&self) -> &Arc<str>—

The visible input value: an edit query while open, otherwise the committed label.

pub fn input_value(&self) -> &Arc<str>
View source
selected_source_indexpub fn selected_source_index(&self) -> Option<usize>—

Configures selected source index for this part.

pub fn selected_source_index(&self) -> Option<usize>
View source
selected_itempub fn selected_item(&self) -> Option<&PickerItem<T>>—

Configures selected item for this part.

pub fn selected_item(&self) -> Option<&PickerItem<T>>
View source
selected_valuepub fn selected_value(&self) -> Option<&T>—

Configures selected value for this part.

pub fn selected_value(&self) -> Option<&T>
View source
selected_labelpub fn selected_label(&self) -> Option<&Arc<str>>—

Configures selected label for this part.

pub fn selected_label(&self) -> Option<&Arc<str>>
View source
set_selected_sourcepub fn set_selected_source(&mut self, source_index: usize, cx: &mut EventContext) -> bool—

Replace the committed selection and close any open suggestion child.

pub fn set_selected_source(&mut self, source_index: usize, cx: &mut EventContext) -> bool
View source
set_selected_idpub fn set_selected_id(&mut self, id: impl Into<ElementId>, cx: &mut EventContext) -> bool—

Configures set selected id for this part.

pub fn set_selected_id(&mut self, id: impl Into<ElementId>, cx: &mut EventContext) -> bool
View source
clear_selectionpub fn clear_selection(&mut self, cx: &mut EventContext) -> bool—

Configures clear selection for this part.

pub fn clear_selection(&mut self, cx: &mut EventContext) -> bool
View source
multiplepub fn multiple(mut self, multiple: bool) -> Self—

Accept more than one committed value, Base UI's `multiple`. A multiple combobox keeps its committed values as bounded chips instead of writing one label back into the input, so the input stays an editing query after every commit.

pub fn multiple(mut self, multiple: bool) -> Self
View source
set_multiplepub fn set_multiple(&mut self, multiple: bool) -> bool—

Replace the multiple flag in place, reporting whether anything changed.

pub fn set_multiple(&mut self, multiple: bool) -> bool
View source
is_multiplepub const fn is_multiple(&self) -> bool—

Configures is multiple for this part.

pub const fn is_multiple(&self) -> bool
View source
auto_highlightpub const fn auto_highlight(mut self, auto_highlight: bool) -> Self—

Highlight the first result as soon as one exists, Base UI's `autoHighlight`.

pub const fn auto_highlight(mut self, auto_highlight: bool) -> Self
View source
auto_highlightspub const fn auto_highlights(&self) -> bool—

Configures auto highlights for this part.

pub const fn auto_highlights(&self) -> bool
View source
open_on_input_clickpub const fn open_on_input_click(mut self, open_on_input_click: bool) -> Self—

Open the suggestion surface when the input itself is clicked, Base UI's `openOnInputClick`.

pub const fn open_on_input_click(mut self, open_on_input_click: bool) -> Self
View source
opens_on_input_clickpub const fn opens_on_input_click(&self) -> bool—

Configures opens on input click for this part.

pub const fn opens_on_input_click(&self) -> bool
View source
highlight_item_on_hoverpub const fn highlight_item_on_hover(mut self, highlight: bool) -> Self—

Move the highlight with the pointer, Base UI's `highlightItemOnHover`.

pub const fn highlight_item_on_hover(mut self, highlight: bool) -> Self
View source
highlights_item_on_hoverpub const fn highlights_item_on_hover(&self) -> bool—

Configures highlights item on hover for this part.

pub const fn highlights_item_on_hover(&self) -> bool
View source
loop_focuspub const fn loop_focus(mut self, loop_focus: bool) -> Self—

Wrap the highlight at the ends of the result set, Base UI's `loop`.

pub const fn loop_focus(mut self, loop_focus: bool) -> Self
View source
loops_focuspub const fn loops_focus(&self) -> bool—

Configures loops focus for this part.

pub const fn loops_focus(&self) -> bool
View source
read_onlypub const fn read_only(mut self, read_only: bool) -> Self—

Refuse value changes while staying focusable, Base UI's `readOnly`.

pub const fn read_only(mut self, read_only: bool) -> Self
View source
is_read_onlypub const fn is_read_only(&self) -> bool—

Configures is read only for this part.

pub const fn is_read_only(&self) -> bool
View source
requiredpub const fn required(mut self, required: bool) -> Self—

Require a value before submission, Base UI's `required`.

pub const fn required(mut self, required: bool) -> Self
View source
is_requiredpub const fn is_required(&self) -> bool—

Configures is required for this part.

pub const fn is_required(&self) -> bool
View source
set_filterpub fn set_filter(&mut self, filter: Option<PickerFilter>, cx: &mut EventContext) -> bool—

Replace the built-in filter policy with an application-supplied predicate, Base UI's `filter`. Passing `None` restores [`Self::filter_mode`], whose combobox default is [`PickerFilterMode::Contains`].

pub fn set_filter(&mut self, filter: Option<PickerFilter>, cx: &mut EventContext) -> bool
View source
with_filterpub fn with_filter(mut self, filter: PickerFilter) -> Self—

Declare an application-supplied filter predicate at construction time.

pub fn with_filter(mut self, filter: PickerFilter) -> Self
View source
filterpub fn filter(&self) -> Option<&PickerFilter>—

The custom filter predicate, when one is installed.

pub fn filter(&self) -> Option<&PickerFilter>
View source
chip_labelspub fn chip_labels(&self) -> impl Iterator<Item = &Arc<str>>—

Every committed chip label, in commit order, Base UI's `Combobox.Chips` contents.

pub fn chip_labels(&self) -> impl Iterator<Item = &Arc<str>>
View source
chip_valuespub fn chip_values(&self) -> impl Iterator<Item = &T>—

Every committed chip value, in commit order.

pub fn chip_values(&self) -> impl Iterator<Item = &T>
View source
chip_countpub fn chip_count(&self) -> usize—

Configures chip count for this part.

pub fn chip_count(&self) -> usize
View source
add_chip_sourcepub fn add_chip_source(&mut self, source_index: usize) -> bool—

Commit one more source row as a chip, up to [`MAX_COMBOBOX_VALUES`]. Returns `false` for a disabled row, an already-committed row, a read-only combobox, or a chip set that is already full.

pub fn add_chip_source(&mut self, source_index: usize) -> bool
View source
remove_chippub fn remove_chip(&mut self, chip_index: usize) -> bool—

Remove one chip, Base UI's `Combobox.ChipRemove`.

pub fn remove_chip(&mut self, chip_index: usize) -> bool
View source
clear_chipspub fn clear_chips(&mut self) -> bool—

Drop every chip.

pub fn clear_chips(&mut self) -> bool
View source
set_pressedpub const fn set_pressed(&mut self, pressed: bool) -> bool—

Record that the trigger is held down, Base UI's `data-pressed`.

pub const fn set_pressed(&mut self, pressed: bool) -> bool
View source
set_focusedpub const fn set_focused(&mut self, focused: bool) -> bool—

Record input focus, and mark the control touched when focus leaves it.

pub const fn set_focused(&mut self, focused: bool) -> bool
View source
reset_touchedpub const fn reset_touched(&mut self) -> bool—

Forget that the control was interacted with, for a form that has just been reset. This is the counterpart of [`Self::reset_dirty`]: a value applied from a declaration is not an interaction, so a host that seeds the control reports Base UI's `data-touched` only for what the user really did.

pub const fn reset_touched(&mut self) -> bool
View source
reset_dirtypub const fn reset_dirty(&mut self) -> bool—

Forget that the value changed, for a form that has just been submitted or reset.

pub const fn reset_dirty(&mut self) -> bool
View source
is_dirtypub const fn is_dirty(&self) -> bool—

Configures is dirty for this part.

pub const fn is_dirty(&self) -> bool
View source
is_touchedpub const fn is_touched(&self) -> bool—

Configures is touched for this part.

pub const fn is_touched(&self) -> bool
View source
is_focusedpub const fn is_focused(&self) -> bool—

Configures is focused for this part.

pub const fn is_focused(&self) -> bool
View source
statepub fn state(&self) -> ComboboxPartState—

A copyable render-state snapshot the application styles from.

pub fn state(&self) -> ComboboxPartState
View source
status_textpub fn status_text(&self) -> Arc<str>—

The live-region text a mounted `Status` part announces, Base UI's `Combobox.Status`. The wording is intentionally minimal and English-free of punctuation so an application can replace it; QuickGUI owns only the counting and the exactly-once announcement.

pub fn status_text(&self) -> Arc<str>
View source
is_empty_resultpub fn is_empty_result(&self) -> bool—

Whether the `Empty` part should be mounted, Base UI's `Combobox.Empty`.

pub fn is_empty_result(&self) -> bool
View source
popover_windowpub const fn popover_window(&self) -> Option<WindowHandle>—

Configures popover window for this part.

pub const fn popover_window(&self) -> Option<WindowHandle>
View source
is_openpub const fn is_open(&self) -> bool—

Configures is open for this part.

pub const fn is_open(&self) -> bool
View source
is_disabledpub const fn is_disabled(&self) -> bool—

Configures is disabled for this part.

pub const fn is_disabled(&self) -> bool
View source
set_disabledpub fn set_disabled(&mut self, disabled: bool, cx: &mut EventContext) -> bool—

Configures set disabled for this part.

pub fn set_disabled(&mut self, disabled: bool, cx: &mut EventContext) -> bool
View source
is_invalidpub const fn is_invalid(&self) -> bool—

Configures is invalid for this part.

pub const fn is_invalid(&self) -> bool
View source
set_invalidpub fn set_invalid(&mut self, invalid: bool) -> bool—

Configures set invalid for this part.

pub fn set_invalid(&mut self, invalid: bool) -> bool
View source
validation_messagepub fn validation_message(&self) -> Option<&Arc<str>>—

Configures validation message for this part.

pub fn validation_message(&self) -> Option<&Arc<str>>
View source
set_validation_messagepub fn set_validation_message(&mut self, message: impl Into<Arc<str>>) -> bool—

Configures set validation message for this part.

pub fn set_validation_message(&mut self, message: impl Into<Arc<str>>) -> bool
View source
clear_validation_messagepub fn clear_validation_message(&mut self) -> bool—

Configures clear validation message for this part.

pub fn clear_validation_message(&mut self) -> bool
View source
result_countpub fn result_count(&self) -> usize—

Configures result count for this part.

pub fn result_count(&self) -> usize
View source
total_match_countpub fn total_match_count(&self) -> usize—

Configures total match count for this part.

pub fn total_match_count(&self) -> usize
View source
active_result_indexpub fn active_result_index(&self) -> Option<usize>—

Configures active result index for this part.

pub fn active_result_index(&self) -> Option<usize>
View source
active_source_indexpub fn active_source_index(&self) -> Option<usize>—

Configures active source index for this part.

pub fn active_source_index(&self) -> Option<usize>
View source
closepub fn close(&mut self, cx: &mut EventContext) -> bool—

Configures close for this part.

pub fn close(&mut self, cx: &mut EventContext) -> bool
View source
surface_idpub fn surface_id(id: impl Into<ElementId>) -> ElementId—

Configures surface id for this part.

pub fn surface_id(id: impl Into<ElementId>) -> ElementId
View source
label_idpub fn label_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the mounted label part.

pub fn label_id(id: impl Into<ElementId>) -> ElementId
View source
value_idpub fn value_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the mounted value part.

pub fn value_id(id: impl Into<ElementId>) -> ElementId
View source
icon_idpub fn icon_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the mounted icon part.

pub fn icon_id(id: impl Into<ElementId>) -> ElementId
View source
input_group_idpub fn input_group_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the input group wrapping the input and its affordances.

pub fn input_group_id(id: impl Into<ElementId>) -> ElementId
View source
clear_idpub fn clear_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the clear control.

pub fn clear_id(id: impl Into<ElementId>) -> ElementId
View source
trigger_idpub fn trigger_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the surface trigger.

pub fn trigger_id(id: impl Into<ElementId>) -> ElementId
View source
chips_idpub fn chips_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the chip container.

pub fn chips_id(id: impl Into<ElementId>) -> ElementId
View source
chip_idpub fn chip_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId—

Stable identity of one chip.

pub fn chip_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId
View source
chip_remove_idpub fn chip_remove_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId—

Stable identity of one chip's remove control.

pub fn chip_remove_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId
View source
backdrop_idpub fn backdrop_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the optional owner-window backdrop.

pub fn backdrop_id(id: impl Into<ElementId>) -> ElementId
View source
arrow_idpub fn arrow_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the decorative popup arrow.

pub fn arrow_id(id: impl Into<ElementId>) -> ElementId
View source
status_idpub fn status_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the result-count live region.

pub fn status_id(id: impl Into<ElementId>) -> ElementId
View source
empty_idpub fn empty_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the no-results part.

pub fn empty_id(id: impl Into<ElementId>) -> ElementId
View source
list_idpub fn list_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the scrolling result list inside the popup.

pub fn list_id(id: impl Into<ElementId>) -> ElementId
View source
collection_idpub fn collection_id(id: impl Into<ElementId>) -> ElementId—

Stable identity of the collection wrapper inside the list.

pub fn collection_id(id: impl Into<ElementId>) -> ElementId
View source
option_id_for_sourcepub fn option_id_for_source( &self, id: impl Into<ElementId>, source_index: usize, ) -> Option<ElementId>—

Configures option id for source for this part.

pub fn option_id_for_source( &self, id: impl Into<ElementId>, source_index: usize, ) -> Option<ElementId>
View source

ComboboxState::root_with

View source
pub fn root_with(root: Element) -> Element

Decorate the optional application-owned structural wrapper, Base UI's `Combobox.Root`.

ComboboxState::root

View source
pub fn root() -> Element

Create the unstyled root part. Use [`Self::root_with`] to supply an existing element.

ComboboxState::label_with

View source
pub fn label_with(id: impl Into<ElementId>, label: Element) -> Element

Decorate the caller-owned visible label, Base UI's `Combobox.Label`.

ComboboxState::label

View source
pub fn label(id: impl Into<ElementId>) -> Element

Create the unstyled label part. Use [`Self::label_with`] to supply an existing element.

ComboboxState::value_with

View source
pub fn value_with(id: impl Into<ElementId>, value: Element) -> Element

Decorate the caller-owned committed-value text, Base UI's `Combobox.Value`. The input already exposes the value, so this part is decoration.

ComboboxState::value

View source
pub fn value(id: impl Into<ElementId>) -> Element

Create the unstyled value part. Use [`Self::value_with`] to supply an existing element.

ComboboxState::icon_with

View source
pub fn icon_with(id: impl Into<ElementId>, icon: Element) -> Element

Decorate the caller-owned affordance glyph, Base UI's `Combobox.Icon`.

ComboboxState::icon

View source
pub fn icon(id: impl Into<ElementId>) -> Element

Create the unstyled icon part. Use [`Self::icon_with`] to supply an existing element.

ComboboxState::input_group_with

View source
pub fn input_group_with(id: impl Into<ElementId>, group: Element) -> Element

Decorate the wrapper holding the input, chips, and affordances, Base UI's `Combobox.InputGroup`.

ComboboxState::input_group

View source
pub fn input_group(id: impl Into<ElementId>) -> Element

Create the unstyled input group part. Use [`Self::input_group_with`] to supply an existing element.

ComboboxState::input_with

View source
pub fn input_with(&self, id: impl Into<ElementId>, input: Element) -> Element

Decorate the caller-owned editable input, Base UI's `Combobox.Input`. The full interaction — filtering, navigation, the suggestion surface, and committing — is attached by [`Self::element`]; this part adds the form-state projection Base UI publishes alongside it, so a composition that already owns the interaction still reports the same required, read-only, and label relationships.

ComboboxState::input

View source
pub fn input(&self, id: impl Into<ElementId>) -> Element

Create the unstyled input part. Use [`Self::input_with`] to supply an existing element.

ComboboxState::chips_with

View source
pub fn chips_with(id: impl Into<ElementId>, chips: Element) -> Element

Decorate the caller-owned chip container, Base UI's `Combobox.Chips`.

ComboboxState::chips

View source
pub fn chips(id: impl Into<ElementId>) -> Element

Create the unstyled chips part. Use [`Self::chips_with`] to supply an existing element.

ComboboxState::chip_with

View source
pub fn chip_with( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, chip: Element, ) -> Element

Decorate one caller-owned chip, Base UI's `Combobox.Chip`.

ComboboxState::chip

View source
pub fn chip( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, ) -> Element

Create the unstyled chip part. Use [`Self::chip_with`] to supply an existing element.

ComboboxState::chip_remove_with

View source
pub fn chip_remove_with( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, remove: Element, ) -> Element

Decorate one chip's remove control, Base UI's `Combobox.ChipRemove`. The control is a real button with an accessible name, so a keyboard user can reach and remove a chip without the pointer.

ComboboxState::chip_remove

View source
pub fn chip_remove( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, ) -> Element

Create the unstyled chip remove part. Use [`Self::chip_remove_with`] to supply an existing element.

ComboboxState::clear_with

View source
pub fn clear_with( id: impl Into<ElementId>, label: impl Into<Arc<str>>, clear: Element, ) -> Element

Decorate the caller-owned clear control, Base UI's `Combobox.Clear`. Mount it only while the control holds a value; Base UI hides it otherwise.

ComboboxState::clear

View source
pub fn clear(id: impl Into<ElementId>, label: impl Into<Arc<str>>) -> Element

Create the unstyled clear part. Use [`Self::clear_with`] to supply an existing element.

ComboboxState::trigger_with

View source
pub fn trigger_with( &self, id: impl Into<ElementId>, label: impl Into<Arc<str>>, trigger: Element, ) -> Element

Decorate the caller-owned surface trigger, Base UI's `Combobox.Trigger`.

ComboboxState::trigger

View source
pub fn trigger(&self, id: impl Into<ElementId>, label: impl Into<Arc<str>>) -> Element

Create the unstyled trigger part. Use [`Self::trigger_with`] to supply an existing element.

ComboboxState::backdrop_with

View source
pub fn backdrop_with(id: impl Into<ElementId>, backdrop: Element) -> Element

Decorate an optional caller-painted owner-window backdrop, Base UI's `Combobox.Backdrop`.

ComboboxState::backdrop

View source
pub fn backdrop(id: impl Into<ElementId>) -> Element

Create the unstyled backdrop part. Use [`Self::backdrop_with`] to supply an existing element.

ComboboxState::portal_with

View source
pub fn portal_with(&self, id: impl Into<ElementId>, portal: Element) -> Element

Decorate the suggestion-surface boundary, Base UI's `Combobox.Portal`. The suggestion surface is its own native window, so the portal, the positioner, and the popup are one element and all three names decorate it identically.

ComboboxState::portal

View source
pub fn portal(&self, id: impl Into<ElementId>) -> Element

Create the unstyled portal part. Use [`Self::portal_with`] to supply an existing element.

ComboboxState::positioner_with

View source
pub fn positioner_with(&self, id: impl Into<ElementId>, positioner: Element) -> Element

Decorate the suggestion-surface boundary, Base UI's `Combobox.Positioner`.

ComboboxState::positioner

View source
pub fn positioner(&self, id: impl Into<ElementId>) -> Element

Create the unstyled positioner part. Use [`Self::positioner_with`] to supply an existing element.

ComboboxState::popup_with

View source
pub fn popup_with(&self, id: impl Into<ElementId>, popup: Element) -> Element

Decorate the caller-owned suggestion surface, Base UI's `Combobox.Popup`.

ComboboxState::popup

View source
pub fn popup(&self, id: impl Into<ElementId>) -> Element

Create the unstyled popup part. Use [`Self::popup_with`] to supply an existing element.

ComboboxState::arrow_with

View source
pub fn arrow_with(id: impl Into<ElementId>, arrow: Element) -> Element

Position a caller-owned decorative arrow, Base UI's `Combobox.Arrow`.

ComboboxState::arrow

View source
pub fn arrow(id: impl Into<ElementId>) -> Element

Create the unstyled arrow part. Use [`Self::arrow_with`] to supply an existing element.

ComboboxState::status_with

View source
pub fn status_with(id: impl Into<ElementId>, status: Element) -> Element

Decorate the caller-owned live region, Base UI's `Combobox.Status`. Render [`Self::status_text`] inside it. The region is polite and is rebuilt only when the application rebuilds the tree, so an unchanged count announces exactly once.

ComboboxState::status

View source
pub fn status(id: impl Into<ElementId>) -> Element

Create the unstyled status part. Use [`Self::status_with`] to supply an existing element.

ComboboxState::empty_with

View source
pub fn empty_with(id: impl Into<ElementId>, empty: Element) -> Element

Decorate the caller-owned no-results part, Base UI's `Combobox.Empty`. Mount it only while [`Self::is_empty_result`] is true. The `Status` region already announces the count, so this part is visual.

ComboboxState::empty

View source
pub fn empty(id: impl Into<ElementId>) -> Element

Create the unstyled empty part. Use [`Self::empty_with`] to supply an existing element.

ComboboxState::list_with

View source
pub fn list_with(&self, id: impl Into<ElementId>, list: Element) -> Element

Decorate the caller-owned scrolling result list, Base UI's `Combobox.List`.

ComboboxState::list

View source
pub fn list(&self, id: impl Into<ElementId>) -> Element

Create the unstyled list part. Use [`Self::list_with`] to supply an existing element.

ComboboxState::collection_with

View source
pub fn collection_with(id: impl Into<ElementId>, collection: Element) -> Element

Decorate a caller-owned wrapper around the mounted rows, Base UI's `Combobox.Collection`.

ComboboxState::collection

View source
pub fn collection(id: impl Into<ElementId>) -> Element

Create the unstyled collection part. Use [`Self::collection_with`] to supply an existing element.

ComboboxState::row_with

View source
pub fn row_with(row: Element) -> Element

Decorate a caller-owned row wrapper for a grid-shaped result, Base UI's `Combobox.Row`.

ComboboxState::row

View source
pub fn row() -> Element

Create the unstyled row part. Use [`Self::row_with`] to supply an existing element.

ComboboxState::item_with

View source
pub fn item_with( &self, id: impl Into<ElementId>, source_index: usize, state: ComboboxItemPartState, item: Element, ) -> Option<Element>

Decorate one caller-owned result row, Base UI's `Combobox.Item`.

ComboboxState::item

View source
pub fn item( &self, id: impl Into<ElementId>, source_index: usize, state: ComboboxItemPartState, ) -> Option<Element>

Create the unstyled item part. Use [`Self::item_with`] to supply an existing element.

ComboboxState::item_indicator_with

View source
pub fn item_indicator_with(indicator: Element) -> Element

Decorate one row's selected mark, Base UI's `Combobox.ItemIndicator`.

ComboboxState::item_indicator

View source
pub fn item_indicator() -> Element

Create the unstyled item indicator part. Use [`Self::item_indicator_with`] to supply an existing element.

ComboboxState::group_with

View source
pub fn group_with(group: Element) -> Element

Decorate a caller-composed result group, Base UI's `Combobox.Group`.

ComboboxState::group

View source
pub fn group() -> Element

Create the unstyled group part. Use [`Self::group_with`] to supply an existing element.

ComboboxState::group_label_with

View source
pub fn group_label_with(label_id: impl Into<ElementId>, label: Element) -> Element

Decorate a group's visible label, Base UI's `Combobox.GroupLabel`.

ComboboxState::group_label

View source
pub fn group_label(label_id: impl Into<ElementId>) -> Element

Create the unstyled group label part. Use [`Self::group_label_with`] to supply an existing element.

ComboboxState::separator_with

View source
pub fn separator_with(separator: Element) -> Element

Decorate a caller-owned divider between groups, Base UI's `Combobox.Separator`.

ComboboxState::separator

View source
pub fn separator() -> Element

Create the unstyled separator part. Use [`Self::separator_with`] to supply an existing element.

ComboboxState::element

View source
pub fn element<V, PopoverRoot, RenderOption, QueryChanged, Change>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, label: impl Into<Arc<str>>, access: fn(&mut V) -> &mut ComboboxState<T>, input: Element, popover_root: PopoverRoot, render_option: RenderOption, query_changed: QueryChanged, change: Change, ) -> Element where V: 'static, T: 'static, PopoverRoot: Fn(ComboboxListState) -> Element + Clone + 'static, RenderOption: Fn(&PickerItem<T>, ComboboxOptionState) -> Element + Clone + 'static, QueryChanged: Fn(&mut V, Arc<str>, &mut EventContext) + Clone + 'static, Change: Fn(&mut V, T, &mut EventContext) + Clone + 'static,

Build the complete unstyled constrained interaction from caller-owned parts.

ComboboxState::element_with

View source
pub fn element_with<V, PopoverRoot, RenderOption, QueryChanged, Change>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, label: impl Into<Arc<str>>, access: StateAccessor<V, ComboboxState<T>>, input: Element, popover_root: PopoverRoot, render_option: RenderOption, query_changed: QueryChanged, change: Change, ) -> Element where V: 'static, T: 'static, PopoverRoot: Fn(ComboboxListState) -> Element + Clone + 'static, RenderOption: Fn(&PickerItem<T>, ComboboxOptionState) -> Element + Clone + 'static, QueryChanged: Fn(&mut V, Arc<str>, &mut EventContext) + Clone + 'static, Change: Fn(&mut V, T, &mut EventContext) + Clone + 'static,

Build the constrained combobox against a per-instance retained-state accessor. A host that renders many declared comboboxes through one view passes an accessor that captures which [`ComboboxState`] each registered listener resolves.