Fusuma

Components / Basics

variant

A button that is primary or not, by a condition (a small convenience for a toggle that looks different when on).

A button that is primary or not, by a condition (a small convenience for a toggle that looks different when on).

Shorthand for choosing between ButtonVariant::Primary and Secondary from a condition.

Signature

pub const fn variant(primary: bool) -> ButtonVariant

Example

use fusuma::{ButtonVariant, variant};
assert_eq!(variant(true), ButtonVariant::Primary);
assert_eq!(variant(false), ButtonVariant::Secondary);

All components · Source