Skip to main content

button_variants

Function button_variants 

Source
pub fn button_variants(
    variant: ButtonVariant,
    size: ButtonSize,
) -> Class<(StaticClass, StaticClass, StaticClass)>
Expand description

Builds the full class list for a button of the given variant and size.

Use it to give button styling to an element that is not a <button>, such as a link styled as a button:

ⓘ
view! {
    <a href="/login" class=(button_variants(ButtonVariant::Outline, ButtonSize::Md))>
        "Sign in"
    </a>
}