ButtonVariant
public enum ButtonVariant
Defines the available visual style variants for themed buttons in SwiftThemeKit.
ButtonVariant controls the button’s background, foreground, border, and elevation behavior
in conjunction with its semantic role (such as .destructive) and pressed state.
These variants can be configured per button using .buttonVariant(_) or via
Theme.buttons.variant for global defaults.
-
A solid-filled button.
- Appearance: Prominent background, high contrast foreground, no border.
- Use case: Primary call-to-action buttons (e.g. “Continue”, “Submit”).
Declaration
Swift
case filled -
A button with a soft background and no elevation or border.
- Appearance: Typically uses a secondary container color.
- Use case: Secondary actions with visual grouping (e.g. cards, forms).
Declaration
Swift
case tonal -
A button with a border and no background fill.
- Appearance: Transparent background, 1pt border.
- Use case: Tertiary or optional actions, often used in inline layouts.
Declaration
Swift
case outline -
A lightly elevated button with a subtle shadow and surface background.
- Appearance: Surface-tinted background with elevation; no border.
- Use case: Medium-emphasis actions that need visual lift but not full prominence.
Declaration
Swift
case elevated -
A minimal button with no background, border, or elevation.
- Appearance: Text only.
- Use case: Inline or low-emphasis actions (e.g. “Cancel”, links).
Declaration
Swift
case text