Skip to main content

TextInputExt

Trait TextInputExt 

Source
pub trait TextInputExt: Sized {
    // Required method
    fn placeholder(self, text: impl Into<Value<String>>) -> Self;
}
Expand description

Builder methods on a text_input element.

Import the trait to use them:

use smudge_text::TextInputExt;
use smudge_text::text_input;
use smudge_core::reactive::RwSignal;

let field = text_input(RwSignal::new(String::new())).placeholder("Name");

Required Methods§

Source

fn placeholder(self, text: impl Into<Value<String>>) -> Self

Sets the text shown while the input is empty.

The placeholder paints in the theme’s muted text color, so a theme switch repaints it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TextInputExt for Element<TextInput>

Source§

fn placeholder(self, text: impl Into<Value<String>>) -> Self

Implementors§