Label

Renders an accessible label associated with controls.

Implicit Labeling

Input components use child text as their label and automatically handle association.

Labels in Fields

Labels used in Fields automatically associate with Field inputs.

Payment Method

All transactions are secure and encrypted

Enter your 16-digit card number

Billing Address

The billing address associated with your payment method

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::Label;

#[component]
pub fn LabelAnatomy() -> impl IntoView {
    view! { <Label /> }
}

API Reference

Label

Renders an accessible label associated with controls.

Custom Attributes
NameTypeDefaultDescription
disabledboolfalse

Set whether or not this element should display as disabled.

invalidboolfalse

Set whether or not this element should display as invalid.

label_forString""

Renamed <label> `for` attribute to avoid name collisions.

Implements global attributes.