functions

Button
Edited: Sunday 25 January 2026

Button

Category: Components
File: form.go
Package: ui

Signature

1func Button(clickable *Clickable, label string) W

Description

Button creates a clickable button widget with accent colors and hover effects.
The button automatically responds to mouse hover by lightening its background.

Example:

btn := &Clickable{}
button := Button(btn, "Click Me")
if btn.Clicked(gtx) {
    // Handle click event
}

The clickable state is managed by the provided Clickable pointer.

Examples

Button

1{
2	btn := &Clickable{}
3	_ = Button(btn, "Click Me")
4}

Example Output


This documentation is auto-generated. To update, run make docs

Backlinks