Skip to main content

Module input

Module input 

Source
Expand description

Text and number inputs: a bg.input field with a 1 px border that turns accent on focus, an error state that keeps the user’s text, a search variant, and numbers with the unit inside the field.

Structs§

InputOutput
What an input drew.
NumberInput
A number field with its unit inside the field.
NumberOutput
TextInput
A single-line text field.

Functions§

evaluate
Evaluate what a user typed into a number field whose unit is unit (“” for none): + - * /, parentheses, and unit names, which multiply the value before them into the field’s unit, so 1/2 in in a millimetre field is 12.7 and 2 in + 5 is 55.8. This is the gallery’s stand-in: the form wiring (rollout step 3) hands the text to the engine’s expression evaluator.
format_number
A value as a field shows it: up to six decimals, no trailing zeros.
number_input
number_input(&mut depth).unit("mm").label("Depth").show(ui).
search_input
A search field: a leading magnifier, and a clear × when not empty.
text_input
A text field. text_input(&mut name).placeholder("Name").show(ui).