Components / TextArea

TextArea

Text on several lines, scrolling past its height or growing with the text.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn text_area() -> impl View {
    let notes = State::new(String::from("Two lines\nto start with."));
    // Grows from 2 to 6 lines as you type; `.rows(4)` would fix the height.
    TextArea::new(notes.binding()).placeholder("Notes").grows(2, 6)
}

Open in the playground, with every example →

Full API of TextArea →