Expand description
Form inputs.
Two flavors, matching how each control naturally behaves in gpui:
- Controlled (
Checkbox,Switch,Radio) areRenderOncebuilders. The parent view owns the value and passes a change handler — wire it withcx.listener(...). - Stateful (
TextInput,Select) are gpui entities (Render+EventEmitter) that own their buffer/open-state. Create withcx.new(|cx| TextInput::new(cx))and subscribe for changes.
Structs§
- Checkbox
- A controlled checkbox. The Mantine
Checkbox. Passcheckedand a change handler (viacx.listener); the parent view owns the value. Or hand it aBindingviaCheckbox::bindand skip the handler. - Checkbox
Group - A vertical group of checkboxes sharing one selection set.
- Color
Input - A color field with a palette dropdown. Create with
cx.new(|cx| ColorInput::new(cx)). - Color
Input Event - Emitted when the color changes (typed, picked, or bound). Carries the color.
- Combobox
- A searchable picker. Create with
cx.new(|cx| Combobox::new(cx).data([..])). - Combobox
Event - Emitted when an option is chosen/toggled. Carries the option index.
- Field
- Label / description / error wrapper around a single control.
- Number
Input - A numeric input. Create with
cx.new(|cx| NumberInput::new(cx)). - Number
Input Event - Emitted when the numeric value changes. Carries the parsed value.
- Password
Input - A password field with an eye toggle. Create with
cx.new(|cx| PasswordInput::new(cx)). - PinInput
- A one-time-code field. Create with
cx.new(|cx| PinInput::new(cx)). - Radio
- A controlled radio button. The Mantine
Radio. Grouping/exclusivity is the parent view’s responsibility — give each acheckedand a change handler. - Radio
Group - A vertical group of radios with a single selected value.
- Range
Slider - A two-thumb range slider. Create with
cx.new(|cx| RangeSlider::new(cx)). - Range
Slider Event - Emitted when either end of the range changes. Carries
(low, high). - Rating
- A star rating. The Mantine
Rating. Controlled: passvalueand anon_change, or two-way bind withRating::bind. - Segmented
Control - A segmented control. Create with
cx.new(|cx| SegmentedControl::new(cx).data(["Day", "Week", "Month"])). - Segmented
Control Event - Emitted when the selected segment changes. Carries the option index.
- Select
- A dropdown picker. Create with
cx.new(|cx| Select::new(cx).data([...])). - Select
Event - Emitted when the user picks an option. Carries the option index.
- Slider
- A horizontal slider. Create with
cx.new(|cx| Slider::new(cx)). - Slider
Event - Emitted when the slider value changes.
- Switch
- A controlled switch. The Mantine
Switch. - Tags
Input - A tag list editor. Create with
cx.new(|cx| TagsInput::new(cx)). - Tags
Input Event - Emitted whenever the tag list changes. Carries the full list.
- Text
Area - A multiline text field. Create with
cx.new(|cx| TextArea::new(cx)). - Text
Area Event - Emitted as the user edits the field. Carries the full new value.
- Text
Edit - An editable line of text with a cursor.
- Text
Input - A single-line text field. Create with
cx.new(|cx| TextInput::new(cx)).
Enums§
- KeyOutcome
- What a keystroke did to a single-line field, so the host can react.
- Password
Input Event - Emitted as the user edits or submits the field.
- PinInput
Event - Emitted as the user edits the code.
- Text
Input Event - Emitted as the user edits or submits the field.
Functions§
- apply_
key - Apply
kstoedit, returning what the host should do.platformis Cmd on macOS;altis Option.