plushie/widget/combo_box
Combo box widget builder (text field with suggestions dropdown).
Types
Option type for combo box properties.
pub type Opt {
Placeholder(String)
Width(length.Length)
Padding(padding.Padding)
Size(Float)
Font(font.Font)
LineHeight(line_height.LineHeight)
MenuHeight(Float)
Icon(node.PropValue)
OnOptionHovered(Bool)
OnOpen(Bool)
OnClose(Bool)
Shaping(shaping.Shaping)
Ellipsis(String)
MenuStyle(node.PropValue)
OnSubmit(Bool)
Style(String)
Required(Bool)
Validation(validation_state.ValidationState)
A11y(a11y.A11y)
}
Constructors
-
Placeholder(String) -
Width(length.Length) -
Padding(padding.Padding) -
Size(Float) -
Font(font.Font) -
LineHeight(line_height.LineHeight) -
MenuHeight(Float) -
Icon(node.PropValue) -
OnOptionHovered(Bool) -
OnOpen(Bool) -
OnClose(Bool) -
Shaping(shaping.Shaping) -
Ellipsis(String) -
MenuStyle(node.PropValue) -
OnSubmit(Bool) -
Style(String) -
Required(Bool) -
Validation(validation_state.ValidationState) -
A11y(a11y.A11y)
Values
pub fn icon(cb: ComboBox, i: node.PropValue) -> ComboBox
Set a custom icon. Pass a DictVal with keys like code_point, size, font, etc.
pub fn line_height(
cb: ComboBox,
lh: line_height.LineHeight,
) -> ComboBox
Set the line height.
pub fn menu_style(cb: ComboBox, ms: node.PropValue) -> ComboBox
Set dropdown menu style overrides. Pass a DictVal with optional keys: background, text_color, selected_text_color, selected_background, border, shadow.
pub fn new(
id: String,
options: List(String),
value: String,
) -> ComboBox
Create a new combo box builder.
pub fn required(cb: ComboBox, r: Bool) -> ComboBox
Mark this field as required. Flows into a11y.required.
pub fn shaping(cb: ComboBox, s: shaping.Shaping) -> ComboBox
Set the text shaping strategy.
pub fn validation(
cb: ComboBox,
v: validation_state.ValidationState,
) -> ComboBox
Set the form-validation state.