All checks were successful
Gitea Actions Demo / publish (push) Successful in 19s
1.8 KiB
1.8 KiB
+++ title = "Button" weight = 1 [extra] section = 1 disclaimer = "These docs are incomplete." +++
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")
}