Input
Use input or text-field for single-line text entry. Both support model-bound text and placeholder, on-input for edit events, and on-submit for Enter. Edit payloads use TextInputEvent from @native-sdk/core/text in a TypeScript core or canvas.TextInputEvent in a Zig core. Use search-field for the same editing behavior with search styling.

Markup
Keep the text in the model and apply each edit in update. See Messages for the reducer contract:
Editing keys
The built-in editor follows the platform keymap in input, text-field, search-field, and combobox: Backspace/Delete remove one caret unit, Option+Backspace/Delete on macOS (Ctrl+Backspace/Delete elsewhere) remove one word, and Command+Backspace on macOS (with or without Shift) deletes from the caret to the beginning of the field. A non-empty selection always wins and is deleted by itself. The semantic edit still arrives through on-input, so applyTextInputEvent and TextBuffer keep controlled fields synchronized and one undo restores the whole deletion.
Search field
search-field uses the same bindings as input. Pair it with a model-filtered list. When it contains text, it displays a clear button. Pressing that button or Escape while focused dispatches a clear edit through on-input. For a suggestions menu, see combobox.

Programmatic construction (Zig)
In a Zig view, the canvas.Ui builder constructs the same tree programmatically. on_input takes a comptime message constructor: Ui.inputMsg(.tag) builds Msg{ .tag = edit } for each canvas.TextInputEvent.
The search field builds the same way:
Attributes
| Attribute | Description |
|---|---|
text | Text value for text-bearing elements; a literal or one {binding}. |
placeholder | Hint text shown while a text entry is empty. |
value | Value for slider/progress/text entry; a literal or one {binding}. |
disabled | Disables the control; true/false or a {binding}. |
autofocus | Focusable controls only: moves keyboard focus to the element when it mounts or when the value turns on (edge-triggered - holding it true never re-steals focus). The TEA way to focus an editor on create. |
on-input | Names a Msg variant with canvas.TextInputEvent payload; delivers each text edit. |
on-submit | Dispatch a Msg on submit: tag or tag:{payload}. Enter in a text field, primary+enter in a textarea; on a list-item, plain Enter dispatches it as the row's primary action while Space keeps the row's select (on-press). |
on-change | Dispatch a Msg on change: tag or tag:{payload}. Hit-target elements only. On a treeitem, Up/Down/Left/Right/Home/End focus movement prefers on-change over on-press, separating keyboard selection from pointer activation. |

