Skip to main content

text_input

Function text_input 

Source
pub fn text_input() -> TextInputBuilder
Expand description

§text_input

Renders an editable text field with Material outlined styling and colors resolved from the active theme.

§Usage

Create an interactive text input for forms, note-taking, or other text input scenarios.

§Parameters

  • enabled — whether the editor is enabled for user input.
  • read_only — whether the editor is read-only.
  • is_error — whether the field is displaying an error state.
  • modifier — optional modifier chain applied to the editor container.
  • on_change — called when text changes.
  • on_submit — called when the user submits a single-line field.
  • min_width — optional minimum width.
  • min_height — optional minimum height.
  • background_color — optional background color.
  • border_width — border width in Dp.
  • border_color — optional border color.
  • shape — container shape.
  • padding — internal padding.
  • presentation_state — optional visual interaction; live interaction takes precedence.
  • focus_border_color — optional focused border color.
  • focus_border_width — optional focused border width.
  • focus_background_color — optional focused background color.
  • selection_color — optional selection highlight color.
  • text_color — optional text color.
  • cursor_color — optional cursor color.
  • accessibility_label — optional accessibility label.
  • accessibility_description — optional accessibility description.
  • initial_text — optional initial text content.
  • font_size — font size in Dp.
  • style — typography override, including weight and letter spacing.
  • line_height — optional line height in Dp.
  • single_line — whether the editor behaves as a single-line field.
  • input_transform — optional transform applied to text changes before on_change.
  • display_transform — optional display-only transform.
  • controller — optional external controller for text, cursor, and selection state.

§Examples

use tessera_components::text_input::text_input;
use tessera_ui::Dp;

text_input().padding(Dp(8.0)).initial_text("Hello World");