pub type Textarea = Field<TextareaMode>;Expand description
A multi-line text field on a TextareaState.
The state’s auto_grow(min, max) sets the height in rows, and
auto_grow(n, n) fixes it at n. Styled on this type (.h(..),
.min_h(..)) refines the frame after the tokens.
use gpui_cn::{Textarea, TextareaState};
use gpui_kit::{AppContext as _, Context, Window};
fn field(window: &mut Window, cx: &mut Context<()>) -> Textarea {
let state = cx.new(|cx| TextareaState::new(window, cx).auto_grow(3, 8));
Textarea::new(&state)
}Aliased Type§
pub struct Textarea { /* private fields */ }