Skip to main content

TextAreaExt

Trait TextAreaExt 

Source
pub trait TextAreaExt: Sized {
    // Required methods
    fn placeholder(self, text: impl Into<Value<String>>) -> Self;
    fn min_lines(self, lines: impl Into<Value<u32>>) -> Self;
}
Expand description

Builder methods on a text_area element.

Import the trait to use them:

use smudge_core::reactive::RwSignal;
use smudge_text::TextAreaExt;
use smudge_text::text_area;

let field = text_area(RwSignal::new(String::new()))
    .placeholder("Notes")
    .min_lines(3);

Required Methods§

Source

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

Sets the text shown while the area is empty.

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

Source

fn min_lines(self, lines: impl Into<Value<u32>>) -> Self

Sets the height floor of the area, in lines, which is one line until this sets it.

The area measures at least lines lines of its style tall, and taller when its text or a style builder’s height needs more. The text scrolls inside whatever height the area ends up with.

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 TextAreaExt for Element<TextArea>

Source§

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

Source§

fn min_lines(self, lines: impl Into<Value<u32>>) -> Self

Implementors§