Displays a form textarea or a component that looks like a textarea.
Yew
Default
New York
textarea.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDemo() -> Html {
html! {
<Textarea placeholder="Type your message here." />
}
}
textarea.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDemo() -> Html {
html! {
<Textarea placeholder="Type your message here." />
}
}
The CLI is not yet available. For now, manually copy the component source into your project.
Yew
rust-shadcn-ui add textarea
Yew
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[component]
fn Usage() -> impl IntoView {
view! {
<Textarea />
}
}
Yew
Default
New York
textarea.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDemo() -> Html {
html! {
<Textarea placeholder="Type your message here." />
}
}
textarea.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDemo() -> Html {
html! {
<Textarea placeholder="Type your message here." />
}
}
Yew
Default
New York
textarea_disabled.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDisabled() -> Html {
html! {
<Textarea placeholder="Type your message here." disabled=true />
}
}
textarea_disabled.rs
use yew::prelude::*;
use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaDisabled() -> Html {
html! {
<Textarea placeholder="Type your message here." disabled=true />
}
}
Yew
Default
New York
textarea_with_label.rs
use yew::prelude::*;
use crate::components::ui::{label::Label, textarea::Textarea};
#[function_component]
pub fn TextareaWithLabel() -> Html {
html! {
<div class="grid w-full gap-1.5">
<Label r#for="message">{"Your message"}</Label>
<Textarea placeholder="Type your message here." id="message" />
</div>
}
}
textarea_with_label.rs
use yew::prelude::*;
use crate::components::ui::{label::Label, textarea::Textarea};
#[function_component]
pub fn TextareaWithLabel() -> Html {
html! {
<div class="grid w-full gap-1.5">
<Label r#for="message">{"Your message"}</Label>
<Textarea placeholder="Type your message here." id="message" />
</div>
}
}
Yew
Default
New York
textarea_with_text.rs
use yew::prelude::*;
use crate::components::ui::{label::Label, textarea::Textarea};
#[function_component]
pub fn TextareaWithText() -> Html {
html! {
<div class="grid w-full gap-1.5">
<Label r#for="message-2">{"Your Message"}</Label>
<Textarea placeholder="Type your message here." id="message-2" />
<p class="text-sm text-muted-foreground">
{"Your message will be copied to the support team."}
</p>
</div>
}
}
textarea_with_text.rs
use yew::prelude::*;
use crate::components::ui::{label::Label, textarea::Textarea};
#[function_component]
pub fn TextareaWithText() -> Html {
html! {
<div class="grid w-full gap-1.5">
<Label r#for="message-2">{"Your Message"}</Label>
<Textarea placeholder="Type your message here." id="message-2" />
<p class="text-sm text-muted-foreground">
{"Your message will be copied to the support team."}
</p>
</div>
}
}
Yew
Default
New York
textarea_with_button.rs
use yew::prelude::*;
use crate::components::ui::{button::Button, textarea::Textarea};
#[function_component]
pub fn TextareaWithButton() -> Html {
html! {
<div class="grid w-full gap-2">
<Textarea placeholder="Type your message here." />
<Button>{"Send message"}</Button>
</div>
}
}
textarea_with_button.rs
use yew::prelude::*;
use crate::components::ui::{button::Button, textarea::Textarea};
#[function_component]
pub fn TextareaWithButton() -> Html {
html! {
<div class="grid w-full gap-2">
<Textarea placeholder="Type your message here." />
<Button>{"Send message"}</Button>
</div>
}
}
Yew
Default
New York
textarea_form.rs
use yew::prelude::*;
// use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaForm() -> Html {
html! {
// TODO
}
}
textarea_form.rs
use yew::prelude::*;
// use crate::components::ui::textarea::Textarea;
#[function_component]
pub fn TextareaForm() -> Html {
html! {
// TODO
}
}