Toggle

A two-state button that toggles between on and off.

Toggle

Outline

With Text

Small

Large

Disabled

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::toggle::Toggle;

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

API Reference

Toggle

A control that toggles between an on and off state.

Custom Attributes
NameTypeDefaultDescription
sizeString""

Specify the size to render the toggle.

pressedReactive<bool>false

A reactive signal coupled to the toggle's pressed state.

variantString""

Specify the style of toggle to render.

Implements global and button attributes.