All checks were successful
Gitea Actions Demo / publish (push) Successful in 21s
1.9 KiB
1.9 KiB
+++ title = "Button" description = "Let the user trigger an event." date = 2024-11-15 [taxonomies] tags = ["Aparoksha", "Windows", "Linux", "macOS"] +++
The button is one of the most common user interface elements. Usually, buttons contain either an icon or a label. It is not recommended to use both in most cases.
For buttons containing a label, use imperative verbs using header capitalization, such as Save or Update. Labels should be kept short.
Label
{{ image(url="labelGNOME.png", alt="A button with a label on GNOME") }}
{{ image(url="labelWindows.png", alt="A button with a label on Windows") }}
Button("Default") {
print("Default")
}
Icon
{{ image(url="iconGNOME.png", alt="A button with an icon on GNOME") }}
{{ image(url="iconWindows.png", alt="A button with an icon on Windows") }}
Button(icon: .airplane) {
print("Action")
}
Label and Icon
{{ image(url="labelIconGNOME.png", alt="A button with a label and an icon on GNOME") }}
{{ image(url="labelIconWindows.png", alt="A button with a label and an icon on Windows") }}
Button("Icon", icon: .airplane) {
print("Icon")
}