enum UI::ButtonStyle

Overview

Visual presentation style for UI::Button.

Maps to UIButton.Configuration variants on iOS 15+ and to NSButton bezel / fill attributes on macOS. HIG: "Use a consistent style to help people understand which buttons perform primary versus secondary actions."

Default — bordered system button. UIButton.Configuration.gray() / NSBezelStyleRounded. The standard interactive affordance for most secondary and utility actions. Prominent — filled blue (or red when role == :destructive). Primary call-to-action per HIG: "Use a filled button for the most likely action in a view." UIButton.Configuration.filled() / NSButton with bezelColor = controlAccentColor. Tinted — translucent tint fill, a softer alternative to Prominent for secondary CTAs. UIButton.Configuration.tinted() / NSButton with NSBezelStyleFlexiblePush. Bordered — explicit bordered button (same as Default on most surfaces; use when you want to be explicit in code). Resolves identically to Default in both renderers. Borderless — no bezel; label text only. UIButton.Configuration.plain() / NSButton with isBordered = false. Use for low-prominence inline actions (e.g. "Learn more", "See details").

Defined in:

ui/views/button.cr

Enum Members

Default = 0
Prominent = 1
Tinted = 2
Bordered = 3
Borderless = 4

Instance Method Summary

Instance Method Detail

def bordered? #

Returns true if this enum value equals Bordered


[View source]
def borderless? #

Returns true if this enum value equals Borderless


[View source]
def default? #

Returns true if this enum value equals Default


[View source]
def prominent? #

Returns true if this enum value equals Prominent


[View source]
def tinted? #

Returns true if this enum value equals Tinted


[View source]