Button

A basic clickable UI component used to trigger actions or events. There are three different kinds of Buttons: PrimaryButton, SecondaryButton & TertiaryButton.

Constructors

PrimaryButton

PrimaryButton uses an internal preset to represent a primary button. See also FilledButton for a custom-colored Button. This may behave slightly different (but more correctly), due to optimizations of the frontend renderer.

	PrimaryButton(func() {
		fmt.Println("Hello World")
	}).Title("Hello World")

package main

import (
	"fmt"
	icons "go.wdy.de/nago/presentation/icons/hero/solid"
	"go.wdy.de/nago/presentation/ui"
)

func main() {
	ui.PrimaryButton(func() {
		fmt.Println("Hello World")
	}).Title("Hello World").PreIcon(icons.SpeakerWave)

}

SecondaryButton

SecondaryButton uses an internal preset to represent a secondary button. See also FilledButton for a custom-colored Button. This may behave slightly different (but more correctly), due to optimizations of the frontend renderer.

	SecondaryButton(func() {
		fmt.Println("Hello World")
	}).Title("Hello World")

TertiaryButton

TertiaryButton uses an internal preset to represent a tertiary button. See also FilledButton for a custom-colored Button. This may behave slightly different (but more correctly), due to optimizations of the frontend renderer.

	TertiaryButton(func() {
		fmt.Println("Hello World")
	}).Title("Hello World")


Methods

MethodDescription
AccessibilityLabel(label string)
Enabled(b bool)Enabled has only an effect for StylePreset otherwise it is ignored.
Font(font Font)
Frame(frame Frame)
ID(id string)
PostIcon(svg core.SVG)
PreIcon(svg core.SVG)
Preset(preset StylePreset)
Title(text string)
Visible(b bool)

Related