Select base theme

Select color scheme

Toggle dark mode

GitHub repository

Button

Displays a button.

Button Size

Use the size prop to change the size of the button.

Default

Outline

Secondary

Ghost

Destructive

Link

Icon

With Icon

Rounded

Spinner

Button Group

Link

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::button::*;

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

API Reference

Button

Creates a button.

Custom Attributes
NameTypeDefaultDescription
as_childboolfalse

This component will render without styling.

button_typeString"submit"

Renamed button `type` attribute to avoid name collisions.

dismissboolfalse

Toggle whether clicking this button dismisses its parent popover.

invalidboolfalse

Toggle whether or not the input is disabled.

sizeString""

Specify the size to render the button. Accepted values: "small" | "large" | "icon" | "sm-icon" | "lg-icon"

variantString"primary"

Specify the style of button to render. Accepted values: "primary" | "secondary" | "outline" | "ghost" | "link" | "destructive"

Implements global and button attributes.