TextEditor
Edit multi-line text with keyboard traits and custom keyboard accessories.
TextEditor is the multi-line input control. Give it a useful height or let a parent layout provide one; unlike a short text field, an editor normally needs visible room for several lines.
The example uses a two-way Text binding. TextChanged is useful for view-local counters or formatting indicators:
The editor exposes ContentKind, Capitalization, Autocorrection, and KeyboardLook, plus font size, weight, and design. It does not provide a single-line return submission command because return inserts a new line.
Keyboard accessories
Set KeyboardToolbar for a standard Done bar. Set KeyboardAccessory when the workflow needs custom formatting or insertion controls; it takes precedence over the toolbar.
Treat maximum length and required content as model validation. A character counter improves feedback, but the save path should still reject invalid values.
Use TextField when return should submit rather than insert a new line.