Skip to main content

Crate day_piece_combobox

Crate day_piece_combobox 

Source
Expand description

day-piece-combobox — an EXTERNAL Day Piece (DESIGN.md §15 tier 1, Appendix B.1): one Rust API, per-toolkit native renderers registered link-time into each backend’s slice, with no edits to Day or its toolkit crates. The Qt and XAML renderers carry their own C++ shims; the Android renderer its own Java factory.

A REAL combo box: free-form text entry PLUS a dropdown of suggestions, as the platform’s genuine combo control — NSComboBox (AppKit), GtkComboBoxText with an entry (GTK), an editable QComboBox (Qt), AutoCompleteTextView (Android), an editable ComboBox (XAML). Because a typed value need not be in the list, the VALUE is the text: a Signal<String> bound two-way, exactly like search_field (typing sets the signal; setting the signal patches the control, echo-guarded). Picking a dropdown item is just another way to set the text — every backend reports it through the same Event::TextChanged. The suggestion list is reactive: items is a Signal<Vec<String>> and changes patch the native list live.

iOS has no native combo-box control, so this piece deliberately carries no uikit renderer — day renders its placeholder leaf there (docs/combobox.md).

let flavor = Signal::new(String::new());
combo_box(flavors, flavor).placeholder("Type or choose…")

Structs§

ComboBox
A native combo box bound two-way to text, with a reactive dropdown of items.
ComboProps
Full props (realize). items seeds the dropdown, text the entry; placeholder is the empty-state prompt (fixed at build). After build, items and text change via ComboPatch.

Enums§

ComboPatch
Sparse imperative updates: replace the dropdown’s items, or the entry’s text (programmatic sync from the bound signal). An items swap must keep the typed text — the text is the value.

Constants§

KIND

Functions§

combo_box
combo_box(items, text) — free-form text entry plus a native dropdown of suggestions. Typing (or picking an item) writes text; setting either signal patches the control.
Day API ↩ Guides· daybrite.dev