pub struct TextareaProps {Show 16 fields
pub value: String,
pub uncontrolled: bool,
pub autocomplete: Option<String>,
pub autocorrect: Option<String>,
pub rows: u32,
pub placeholder: String,
pub size: Size,
pub disabled: bool,
pub readonly: bool,
pub oninput: Option<EventHandler<FormEvent>>,
pub onchange: Option<EventHandler<FormEvent>>,
pub onfocus: Option<EventHandler<FocusEvent>>,
pub onblur: Option<EventHandler<FocusEvent>>,
pub onkeydown: Option<EventHandler<KeyboardEvent>>,
pub onkeyup: Option<EventHandler<KeyboardEvent>>,
pub class: String,
/* private fields */
}Expand description
Bootstrap Textarea component.
§Bootstrap HTML → Dioxus
| HTML | Dioxus |
|---|---|
<textarea class="form-control" rows="5"> | Textarea { rows: 5 } |
<textarea class="form-control form-control-sm"> | Textarea { size: Size::Sm } |
<textarea class="form-control" placeholder="..." disabled> | Textarea { placeholder: "...", disabled: true } |
rsx! {
Textarea { rows: 5, placeholder: "Enter description..." }
}Fields§
§value: StringCurrent value.
uncontrolled: boolWhen true, the value attribute is omitted so the field is
uncontrolled: the DOM keeps whatever value the user or an external
script writes, instead of Dioxus forcing it back to value on every
render. Use for a field another script streams into (e.g. a live
transcript box).
autocomplete: Option<String>Browser autocomplete hint.
autocorrect: Option<String>Safari’s autocorrect hint (on / off) — the attribute a compose box
most often needs turned off, and not one GlobalAttributes carries.
rows: u32Number of visible rows.
placeholder: StringPlaceholder text.
size: SizeTextarea size.
disabled: boolDisabled state.
readonly: boolReadonly state.
oninput: Option<EventHandler<FormEvent>>Input event handler.
onchange: Option<EventHandler<FormEvent>>Change event handler.
onfocus: Option<EventHandler<FocusEvent>>Focus event handler.
onblur: Option<EventHandler<FocusEvent>>Blur event handler.
onkeydown: Option<EventHandler<KeyboardEvent>>Key down event handler.
onkeyup: Option<EventHandler<KeyboardEvent>>Key up event handler.
class: StringAdditional CSS classes.
Implementations§
Source§impl TextareaProps
impl TextareaProps
Sourcepub fn builder() -> TextareaPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TextareaPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TextareaProps.
On the builder, call .value(...)(optional), .uncontrolled(...)(optional), .autocomplete(...)(optional), .autocorrect(...)(optional), .rows(...)(optional), .placeholder(...)(optional), .size(...)(optional), .disabled(...)(optional), .readonly(...)(optional), .oninput(...)(optional), .onchange(...)(optional), .onfocus(...)(optional), .onblur(...)(optional), .onkeydown(...)(optional), .onkeyup(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TextareaProps.
Trait Implementations§
Source§impl Clone for TextareaProps
impl Clone for TextareaProps
Source§fn clone(&self) -> TextareaProps
fn clone(&self) -> TextareaProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more