Switch Components

Switch components provide toggle functionality with multiple colors and variants.

Switch Basic

Supports multiple colors: Success, Primary, Secondary, Danger, Warning, Info.

Switch Icon Variant

Switch with icons, default provides ✓ and ✗ symbols.

Switch Text Variant

Switch with text labels, automatically adjusts slider width.

Switch Size Variant

Supports Small, Medium, Large sizes.

Progress

Progress bar component for displaying operation progress.

Slider

Slider component for numeric selection.

API

SwitchProps

PropertyTypeDefaultDescription
checkedboolfalseWhether checked
on_changeEventEmitter<bool>-State change callback
disabledboolfalseWhether disabled
sizeSwitchSizeMediumSize
variantSwitchVariantDefaultVariant type
colorSwitchColorSuccessColor when checked
checked_contentOption<SwitchContent>NoneContent when checked
unchecked_contentOption<SwitchContent>NoneContent when unchecked

SwitchVariant

ValueDescription
DefaultDefault style (dot)
TextText variant
IconIcon variant
CustomCustom variant

SwitchColor

ValueDescription
SuccessSuccess/On (green, default)
PrimaryPrimary color (blue)
SecondarySecondary color (purple)
DangerDanger (red)
WarningWarning (yellow)
InfoInfo (indigo)

SwitchContent

ValueDescription
Text(String)Text content
Icon(SwitchIcon)Icon content
Image(String)Image URL

SwitchIcon

ValueDescription
CheckCheck icon
CloseClose icon
PlusPlus icon
MinusMinus icon
Custom(&'static str)Custom SVG path