本文へスキップ

Combobox

編集可能なテキスト、絞り込み、任意のチップ、ネイティブの候補表示を組み合わせます。

#インポート

quickgui から Combobox をインポートします。

use quickgui::*;

#使い方

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

#構成

  • 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 リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

ComboboxState

ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
layoutpub const fn layout(&self) -> ComboboxPopoverLayout—

Configures layout for this part.

pub const fn layout(&self) -> ComboboxPopoverLayout
ソースを見る
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
ソースを見る
itemspub fn items(&self) -> &[PickerItem<T>]—

Configures items for this part.

pub fn items(&self) -> &[PickerItem<T>]
ソースを見る
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>
ソースを見る
filter_modepub const fn filter_mode(&self) -> PickerFilterMode—

Configures filter mode for this part.

pub const fn filter_mode(&self) -> PickerFilterMode
ソースを見る
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
ソースを見る
querypub fn query(&self) -> &Arc<str>—

Configures query for this part.

pub fn query(&self) -> &Arc<str>
ソースを見る
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>
ソースを見る
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>
ソースを見る
selected_itempub fn selected_item(&self) -> Option<&PickerItem<T>>—

Configures selected item for this part.

pub fn selected_item(&self) -> Option<&PickerItem<T>>
ソースを見る
selected_valuepub fn selected_value(&self) -> Option<&T>—

Configures selected value for this part.

pub fn selected_value(&self) -> Option<&T>
ソースを見る
selected_labelpub fn selected_label(&self) -> Option<&Arc<str>>—

Configures selected label for this part.

pub fn selected_label(&self) -> Option<&Arc<str>>
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
is_multiplepub const fn is_multiple(&self) -> bool—

Configures is multiple for this part.

pub const fn is_multiple(&self) -> bool
ソースを見る
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
ソースを見る
auto_highlightspub const fn auto_highlights(&self) -> bool—

Configures auto highlights for this part.

pub const fn auto_highlights(&self) -> bool
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
loops_focuspub const fn loops_focus(&self) -> bool—

Configures loops focus for this part.

pub const fn loops_focus(&self) -> bool
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
is_requiredpub const fn is_required(&self) -> bool—

Configures is required for this part.

pub const fn is_required(&self) -> bool
ソースを見る
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
ソースを見る
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
ソースを見る
filterpub fn filter(&self) -> Option<&PickerFilter>—

The custom filter predicate, when one is installed.

pub fn filter(&self) -> Option<&PickerFilter>
ソースを見る
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>>
ソースを見る
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>
ソースを見る
chip_countpub fn chip_count(&self) -> usize—

Configures chip count for this part.

pub fn chip_count(&self) -> usize
ソースを見る
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
ソースを見る
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
ソースを見る
clear_chipspub fn clear_chips(&mut self) -> bool—

Drop every chip.

pub fn clear_chips(&mut self) -> bool
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
is_dirtypub const fn is_dirty(&self) -> bool—

Configures is dirty for this part.

pub const fn is_dirty(&self) -> bool
ソースを見る
is_touchedpub const fn is_touched(&self) -> bool—

Configures is touched for this part.

pub const fn is_touched(&self) -> bool
ソースを見る
is_focusedpub const fn is_focused(&self) -> bool—

Configures is focused for this part.

pub const fn is_focused(&self) -> bool
ソースを見る
statepub fn state(&self) -> ComboboxPartState—

A copyable render-state snapshot the application styles from.

pub fn state(&self) -> ComboboxPartState
ソースを見る
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>
ソースを見る
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
ソースを見る
popover_windowpub const fn popover_window(&self) -> Option<WindowHandle>—

Configures popover window for this part.

pub const fn popover_window(&self) -> Option<WindowHandle>
ソースを見る
is_openpub const fn is_open(&self) -> bool—

Configures is open for this part.

pub const fn is_open(&self) -> bool
ソースを見る
is_disabledpub const fn is_disabled(&self) -> bool—

Configures is disabled for this part.

pub const fn is_disabled(&self) -> bool
ソースを見る
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
ソースを見る
is_invalidpub const fn is_invalid(&self) -> bool—

Configures is invalid for this part.

pub const fn is_invalid(&self) -> bool
ソースを見る
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
ソースを見る
validation_messagepub fn validation_message(&self) -> Option<&Arc<str>>—

Configures validation message for this part.

pub fn validation_message(&self) -> Option<&Arc<str>>
ソースを見る
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
ソースを見る
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
ソースを見る
result_countpub fn result_count(&self) -> usize—

Configures result count for this part.

pub fn result_count(&self) -> usize
ソースを見る
total_match_countpub fn total_match_count(&self) -> usize—

Configures total match count for this part.

pub fn total_match_count(&self) -> usize
ソースを見る
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>
ソースを見る
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>
ソースを見る
closepub fn close(&mut self, cx: &mut EventContext) -> bool—

Configures close for this part.

pub fn close(&mut self, cx: &mut EventContext) -> bool
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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
ソースを見る
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>
ソースを見る

ComboboxState::root_with

ソースを見る
pub fn root_with(root: Element) -> Element

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

ComboboxState::root

ソースを見る
pub fn root() -> Element

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

ComboboxState::label_with

ソースを見る
pub fn label_with(id: impl Into<ElementId>, label: Element) -> Element

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

ComboboxState::label

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn icon_with(id: impl Into<ElementId>, icon: Element) -> Element

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

ComboboxState::icon

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn chips_with(id: impl Into<ElementId>, chips: Element) -> Element

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

ComboboxState::chips

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn positioner_with(&self, id: impl Into<ElementId>, positioner: Element) -> Element

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

ComboboxState::positioner

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn arrow_with(id: impl Into<ElementId>, arrow: Element) -> Element

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

ComboboxState::arrow

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn row() -> Element

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

ComboboxState::item_with

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn item_indicator_with(indicator: Element) -> Element

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

ComboboxState::item_indicator

ソースを見る
pub fn item_indicator() -> Element

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

ComboboxState::group_with

ソースを見る
pub fn group_with(group: Element) -> Element

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

ComboboxState::group

ソースを見る
pub fn group() -> Element

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

ComboboxState::group_label_with

ソースを見る
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

ソースを見る
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

ソースを見る
pub fn separator_with(separator: Element) -> Element

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

ComboboxState::separator

ソースを見る
pub fn separator() -> Element

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

ComboboxState::element

ソースを見る
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

ソースを見る
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.