Select base theme

Select color scheme

Toggle dark mode

GitHub repository

Badge

Displays a badge component.

BadgeSecondaryDestructiveOutline

Variants

Use the variant prop to change the variant of the badge.

InvalidSecondaryDestructiveOutlineGhost

With Icon

VerifiedBookmark

With Spinner

DeletingGenerating

Link

Anatomy

Import all parts and piece them together.

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

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

API Reference

Badge

Contains arbitrary badge content.

Custom Attributes
NameTypeDefaultDescription
invalidboolfalse

Toggle whether or not this badge appears invalid.

variantString"primary"

Define the badge variant. Accepted values: "primary" | "secondary" | "destructive" | "outline"

Implements global attributes.