Renders an accessible label associated with controls.
use yew::prelude::*;
use crate::components::ui::label::Label;
#[function_component]
pub fn LabelDemo() -> Html {
html! {
<div>
<div class="flex items-center space-x-2">
// TODO
// <Checkbox id="terms" />
<Label r#for="terms">{"Accept terms and conditions"}</Label>
</div>
</div>
}
}
use yew::prelude::*;
use crate::components::ui::label::Label;
#[function_component]
pub fn LabelDemo() -> Html {
html! {
<div>
<div class="flex items-center space-x-2">
// TODO
// <Checkbox id="terms" />
<Label r#for="terms">{"Accept terms and conditions"}</Label>
</div>
</div>
}
}
The CLI is not yet available. For now, manually copy the component source into your project.
use yew::prelude::*;
use crate::components::ui::label::Label;
#[component]
fn Usage() -> impl IntoView {
view! {
<Label r#for="email">{"Your email address"}</Label>
}
}