Skip to main content

TextInputBuilder

Struct TextInputBuilder 

Source
pub struct TextInputBuilder { /* private fields */ }
Expand description

Configuration handle returned by text_input.

Implementations§

Source§

impl TextInputBuilder

§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
  • Parameters configure the editor’s appearance, layout, transforms, and controller state.
§Examples
use tessera_components::text_input::text_input;
use tessera_ui::Dp;

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

pub fn display_transform_mapped<F>(&self, transform: F) -> Self
where F: Fn(&str) -> DisplayTransformText + Send + Sync + 'static,

Set a display-only transform with explicit offset mapping.

Source§

impl TextInputBuilder

Source

pub fn enabled(&self, value: bool) -> Self

Configure enabled before this component executes.

Source

pub fn enabled_optional(&self, value: Option<bool>) -> Self

Configure enabled before this component executes.

Source

pub fn presentation_state(&self, value: InteractionVisualState) -> Self

Configure presentation_state before this component executes.

Source

pub fn presentation_state_optional( &self, value: Option<InteractionVisualState>, ) -> Self

Configure presentation_state before this component executes.

Source

pub fn read_only(&self, value: bool) -> Self

Configure read_only before this component executes.

Source

pub fn read_only_optional(&self, value: Option<bool>) -> Self

Configure read_only before this component executes.

Source

pub fn is_error(&self, value: bool) -> Self

Configure is_error before this component executes.

Source

pub fn is_error_optional(&self, value: Option<bool>) -> Self

Configure is_error before this component executes.

Source

pub fn modifier(&self, value: Modifier) -> Self

Configure modifier before this component executes.

Source

pub fn modifier_optional(&self, value: Option<Modifier>) -> Self

Configure modifier before this component executes.

Source

pub fn on_change<F>(&self, value: F) -> Self
where F: Fn(String) -> String + Send + Sync + 'static,

Configure on_change before this component executes.

Source

pub fn on_change_shared( &self, value: impl Into<CallbackWith<String, String>> + Send + Sync + 'static, ) -> Self

Configure on_change before this component executes.

Source

pub fn on_change_optional( &self, value: Option<CallbackWith<String, String>>, ) -> Self

Configure on_change before this component executes.

Source

pub fn on_submit<F>(&self, value: F) -> Self
where F: Fn() + Send + Sync + 'static,

Configure on_submit before this component executes.

Source

pub fn on_submit_shared( &self, value: impl Into<Callback> + Send + Sync + 'static, ) -> Self

Configure on_submit before this component executes.

Source

pub fn on_submit_optional(&self, value: Option<Callback>) -> Self

Configure on_submit before this component executes.

Source

pub fn min_width(&self, value: Dp) -> Self

Configure min_width before this component executes.

Source

pub fn min_width_optional(&self, value: Option<Dp>) -> Self

Configure min_width before this component executes.

Source

pub fn min_height(&self, value: Dp) -> Self

Configure min_height before this component executes.

Source

pub fn min_height_optional(&self, value: Option<Dp>) -> Self

Configure min_height before this component executes.

Source

pub fn background_color(&self, value: Color) -> Self

Configure background_color before this component executes.

Source

pub fn background_color_optional(&self, value: Option<Color>) -> Self

Configure background_color before this component executes.

Source

pub fn border_width(&self, value: Dp) -> Self

Configure border_width before this component executes.

Source

pub fn border_width_optional(&self, value: Option<Dp>) -> Self

Configure border_width before this component executes.

Source

pub fn border_color(&self, value: Color) -> Self

Configure border_color before this component executes.

Source

pub fn border_color_optional(&self, value: Option<Color>) -> Self

Configure border_color before this component executes.

Source

pub fn shape(&self, value: Shape) -> Self

Configure shape before this component executes.

Source

pub fn shape_optional(&self, value: Option<Shape>) -> Self

Configure shape before this component executes.

Source

pub fn padding(&self, value: Dp) -> Self

Configure padding before this component executes.

Source

pub fn padding_optional(&self, value: Option<Dp>) -> Self

Configure padding before this component executes.

Source

pub fn focus_border_color(&self, value: Color) -> Self

Configure focus_border_color before this component executes.

Source

pub fn focus_border_color_optional(&self, value: Option<Color>) -> Self

Configure focus_border_color before this component executes.

Source

pub fn focus_border_width(&self, value: Dp) -> Self

Configure focus_border_width before this component executes.

Source

pub fn focus_border_width_optional(&self, value: Option<Dp>) -> Self

Configure focus_border_width before this component executes.

Source

pub fn focus_background_color(&self, value: Color) -> Self

Configure focus_background_color before this component executes.

Source

pub fn focus_background_color_optional(&self, value: Option<Color>) -> Self

Configure focus_background_color before this component executes.

Source

pub fn selection_color(&self, value: Color) -> Self

Configure selection_color before this component executes.

Source

pub fn selection_color_optional(&self, value: Option<Color>) -> Self

Configure selection_color before this component executes.

Source

pub fn text_color(&self, value: Color) -> Self

Configure text_color before this component executes.

Source

pub fn text_color_optional(&self, value: Option<Color>) -> Self

Configure text_color before this component executes.

Source

pub fn cursor_color(&self, value: Color) -> Self

Configure cursor_color before this component executes.

Source

pub fn cursor_color_optional(&self, value: Option<Color>) -> Self

Configure cursor_color before this component executes.

Source

pub fn accessibility_label(&self, value: impl Into<String>) -> Self

Configure accessibility_label before this component executes.

Source

pub fn accessibility_label_optional(&self, value: Option<String>) -> Self

Configure accessibility_label before this component executes.

Source

pub fn accessibility_description(&self, value: impl Into<String>) -> Self

Configure accessibility_description before this component executes.

Source

pub fn accessibility_description_optional(&self, value: Option<String>) -> Self

Configure accessibility_description before this component executes.

Source

pub fn initial_text(&self, value: impl Into<String>) -> Self

Configure initial_text before this component executes.

Source

pub fn initial_text_optional(&self, value: Option<String>) -> Self

Configure initial_text before this component executes.

Source

pub fn font_size(&self, value: Dp) -> Self

Configure font_size before this component executes.

Source

pub fn font_size_optional(&self, value: Option<Dp>) -> Self

Configure font_size before this component executes.

Source

pub fn line_height(&self, value: Dp) -> Self

Configure line_height before this component executes.

Source

pub fn line_height_optional(&self, value: Option<Dp>) -> Self

Configure line_height before this component executes.

Source

pub fn style(&self, value: TextStyle) -> Self

Configure style before this component executes.

Source

pub fn style_optional(&self, value: Option<TextStyle>) -> Self

Configure style before this component executes.

Source

pub fn single_line(&self, value: bool) -> Self

Configure single_line before this component executes.

Source

pub fn single_line_optional(&self, value: Option<bool>) -> Self

Configure single_line before this component executes.

Source

pub fn input_transform<F>(&self, value: F) -> Self
where F: Fn(String) -> String + Send + Sync + 'static,

Configure input_transform before this component executes.

Source

pub fn input_transform_shared( &self, value: impl Into<CallbackWith<String, String>> + Send + Sync + 'static, ) -> Self

Configure input_transform before this component executes.

Source

pub fn input_transform_optional( &self, value: Option<CallbackWith<String, String>>, ) -> Self

Configure input_transform before this component executes.

Source

pub fn display_transform(&self, value: DisplayTransform) -> Self

Configure display_transform before this component executes.

Source

pub fn display_transform_optional( &self, value: Option<DisplayTransform>, ) -> Self

Configure display_transform before this component executes.

Source

pub fn controller(&self, value: State<TextInputController>) -> Self

Configure controller before this component executes.

Source

pub fn controller_optional( &self, value: Option<State<TextInputController>>, ) -> Self

Configure controller before this component executes.

Source§

impl TextInputBuilder

Presets for an already declared text input.

Source

pub fn simple(&self) -> Self

Creates a simple text input with default styling.

  • Minimum width: 120dp
  • Background: white
  • Border: 1px gray, rounded rectangle
§Example
use tessera_components::text_input::text_input;
let args = text_input().simple();
Source

pub fn outlined(&self) -> Self

Creates a text input with an emphasized border for better visibility.

  • Border: 2px, blue focus border
§Example
use tessera_components::text_input::text_input;
let args = text_input().outlined();
Source

pub fn minimal(&self) -> Self

Creates a text input with no border (minimal style).

  • Border: 0px, square corners
§Example
use tessera_components::text_input::text_input;
let args = text_input().minimal();

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> SendSync for T
where T: Send + Sync + 'static,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more