willowui

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 16 Imported by: 0

README

WillowUI

CI Go Reference Go Report Card

A reactive UI toolkit for Go, built on Willow and Ebitengine. WillowUI provides a complete widget library, reactive state management, JSON theming, and XML templating for building desktop and game UIs.

Status: Actively developed. API may change before v1.0.0.

Buttons Text Input

Sortable Tree List Calendar

Features

  • 50+ widgets -- buttons, text inputs, sliders, lists, trees, data tables, menus, color pickers, modals, toasts, and more
  • Reactive state -- Ref, Computed, WatchEffect, reactive Array and Record types that drive automatic UI updates
  • JSON theming -- style every widget property from a single JSON file; ships with 7 built-in themes
  • XML templates -- declare layouts in XML with reactive bindings, conditionals, and event handlers
  • Layout system -- VBox, HBox, Anchor, Flow, and TwoColumn layouts with padding, spacing, and alignment
  • Rich text -- inline markup for bold, italic, color, and size within a single text widget
  • Focus management -- tab navigation, focus rings, and keyboard-driven interaction
  • Screen management -- push, pop, and replace screens with a built-in stage manager
  • Visual test runner -- automated screenshot testing via JSON scripts and input injection

Quick Start

go get github.com/devthicket/willowui
package main

import (
	"github.com/devthicket/willow"
	ui "github.com/devthicket/willowui"
)

func main() {
	font := ui.MustLoadDefaultFont()
	clicks := ui.NewRef(0)

	btn := ui.NewButton("inc", "+1", font, 16)
	btn.SetOnClick(ui.Increment(clicks, 1))

	label := ui.NewLabel("count", "0", font, 36)
	formatted, _ := ui.BindFormatterf(clicks, "Count: %d") // app-lifetime: handle not stopped
	label.BindText(formatted)

	row := ui.NewHBox("row")
	row.Spacing = 16
	row.SetPosition(20, 15)
	row.AddChild(btn)
	row.AddChild(label)

	ui.Setup(ui.StageConfig{
		Title:      "Counter",
		Width:      400,
		Height:     70,
		ClearColor: willow.RGBA(0.08, 0.08, 0.10, 1),
	}, row)
}

Widgets

Category Widgets
Input Button, IconButton, TextInput, TextArea, MaskedInput, KeybindInput, SearchBox
Selection Checkbox, RadioButton, Toggle, OptionRotator, Select
Range Slider, NumberStepper, ProgressBar, MeterBar, ScrollBar
Lists List, TreeList, TileList, SortableList, SortableTreeList, DataTable, TreeTable
Containers Panel, Window, ScrollPanel, NavDrawer, Accordion, Popover
Navigation TabBar, ToggleButtonBar, ToolBar, MenuBar
Display Label, RichText, Badge, Tag, TagBar, Tooltip, Toast, Image, AnimatedImage
Specialty ColorPicker, GradientEditor, ImageCropper, TimePicker, CalendarSelector, StatWeb, DragHandle, InputField
Widget gallery (click to expand)
Accordion Calendar
Checkbox Color Picker
Data Table List
Masked Input Menu Bar
Number Stepper Option Rotator
Progress Bar Radio
Scroll Panel Select
Slider Sortable List
Sortable Tree List Stat Web
Tab Bar Tag Bar
Text Area Text Input
Tile List Time Picker
Toggle Toggle Button Bar
Tooltip Tree List
Window Button

Theming

Themes are plain JSON. Load one and every widget picks it up:

theme, err := ui.LoadThemeFromFile("themes/dark.json")
ui.SetTheme(theme)

Ships with 7 built-in themes: dark, forest, jrpg, macos, neon, windows, and debug. Create your own -- each widget type has its own section with full control over colors, corners, padding, and more. See the theme docs for the full schema.

XML Templates

Define layouts declaratively and bind reactive state:

<VBox padding="16" spacing="8">
    <Label text="Hello, {{name}}" fontSize="24" />
    <Button text="Click me" on:click="handleClick" />
</VBox>

Templates compile to a binary format for fast startup, and support hot reload during development.

Examples

The examples/ directory has 60+ runnable demos:

go run ./examples/widgets/buttons/
go run ./examples/reactive/counter/
go run ./examples/templating/xml-basic/
go run ./examples/theming/theme-gallery/

Built with

  • Go 1.24+
  • Willow -- scene graph rendering engine
  • Ebitengine v2.9+ -- GPU backend

Contributing

Contributions are welcome. Please open an issue first for major changes to discuss the design. For bug fixes and small improvements, open a pull request directly.

go build ./...
go test ./...
go vet ./...

License

MIT

Documentation

Index

Constants

View Source
const (
	StateDefault       = core.StateDefault       // Normal idle state.
	StateHover         = core.StateHover         // Pointer is over the component.
	StateActive        = core.StateActive        // Component is being pressed.
	StateDisabled      = core.StateDisabled      // Component is non-interactive.
	StateFocus         = core.StateFocus         // Component has keyboard focus.
	StateFocusHover    = core.StateFocusHover    // Focused and hovered.
	StateFocusActive   = core.StateFocusActive   // Focused and pressed.
	StateFocusDisabled = core.StateFocusDisabled // Focused but disabled.
)
View Source
const (
	BgNone      = core.BgNone      // No background rendered.
	BgSolid     = core.BgSolid     // Flat solid-color fill.
	BgNineSlice = core.BgNineSlice // Nine-slice image background.
	BgGradient  = core.BgGradient  // Per-corner gradient fill.
)
View Source
const (
	Primary   = theme.Primary   // Primary action or branding color.
	Secondary = theme.Secondary // Secondary or supporting color.
	Accent    = theme.Accent    // Accent highlight color.
	Neutral   = theme.Neutral   // Neutral/muted color.
	Danger    = theme.Danger    // Destructive or error actions.
	Success   = theme.Success   // Positive confirmation.
	Warning   = theme.Warning   // Caution or non-blocking alert.
	Info      = theme.Info      // Informational or help context.
	Custom1   = theme.Custom1   // Application-defined variant 1.
	Custom2   = theme.Custom2   // Application-defined variant 2.
	Custom3   = theme.Custom3   // Application-defined variant 3.
	Custom4   = theme.Custom4   // Application-defined variant 4.
	Custom5   = theme.Custom5   // Application-defined variant 5.
	Custom6   = theme.Custom6   // Application-defined variant 6.
	Custom7   = theme.Custom7   // Application-defined variant 7.
	Custom8   = theme.Custom8   // Application-defined variant 8.
	Custom9   = theme.Custom9   // Application-defined variant 9.
	Custom10  = theme.Custom10  // Application-defined variant 10.
	Custom11  = theme.Custom11  // Application-defined variant 11.
	Custom12  = theme.Custom12  // Application-defined variant 12.
	Custom13  = theme.Custom13  // Application-defined variant 13.
	Custom14  = theme.Custom14  // Application-defined variant 14.
	Custom15  = theme.Custom15  // Application-defined variant 15.
	Custom16  = theme.Custom16  // Application-defined variant 16.
	Custom17  = theme.Custom17  // Application-defined variant 17.
	Custom18  = theme.Custom18  // Application-defined variant 18.
	Custom19  = theme.Custom19  // Application-defined variant 19.
	Custom20  = theme.Custom20  // Application-defined variant 20.
	Custom21  = theme.Custom21  // Application-defined variant 21.
	Custom22  = theme.Custom22  // Application-defined variant 22.
	Custom23  = theme.Custom23  // Application-defined variant 23.
	Custom24  = theme.Custom24  // Application-defined variant 24.
	Custom25  = theme.Custom25  // Application-defined variant 25.
	Custom26  = theme.Custom26  // Application-defined variant 26.
	Custom27  = theme.Custom27  // Application-defined variant 27.
	Custom28  = theme.Custom28  // Application-defined variant 28.
	Custom29  = theme.Custom29  // Application-defined variant 29.
	Custom30  = theme.Custom30  // Application-defined variant 30.
	Custom31  = theme.Custom31  // Application-defined variant 31.
	Custom32  = theme.Custom32  // Application-defined variant 32.
	Custom33  = theme.Custom33  // Application-defined variant 33.
	Custom34  = theme.Custom34  // Application-defined variant 34.
	Custom35  = theme.Custom35  // Application-defined variant 35.
	Custom36  = theme.Custom36  // Application-defined variant 36.
	Custom37  = theme.Custom37  // Application-defined variant 37.
	Custom38  = theme.Custom38  // Application-defined variant 38.
	Custom39  = theme.Custom39  // Application-defined variant 39.
	Custom40  = theme.Custom40  // Application-defined variant 40.
	Custom41  = theme.Custom41  // Application-defined variant 41.
	Custom42  = theme.Custom42  // Application-defined variant 42.
	Custom43  = theme.Custom43  // Application-defined variant 43.
	Custom44  = theme.Custom44  // Application-defined variant 44.
	Custom45  = theme.Custom45  // Application-defined variant 45.
	Custom46  = theme.Custom46  // Application-defined variant 46.
	Custom47  = theme.Custom47  // Application-defined variant 47.
	Custom48  = theme.Custom48  // Application-defined variant 48.
	Custom49  = theme.Custom49  // Application-defined variant 49.
	Custom50  = theme.Custom50  // Application-defined variant 50.
	Custom51  = theme.Custom51  // Application-defined variant 51.
	Custom52  = theme.Custom52  // Application-defined variant 52.
	Custom53  = theme.Custom53  // Application-defined variant 53.
	Custom54  = theme.Custom54  // Application-defined variant 54.
	Custom55  = theme.Custom55  // Application-defined variant 55.
	Custom56  = theme.Custom56  // Application-defined variant 56.
)
View Source
const (
	LayoutNone   = widget.LayoutNone   // No automatic layout; children are manually positioned.
	LayoutVBox   = widget.LayoutVBox   // Vertical stack layout.
	LayoutHBox   = widget.LayoutHBox   // Horizontal row layout.
	LayoutGrid   = widget.LayoutGrid   // Grid layout with rows and columns.
	LayoutFlow   = widget.LayoutFlow   // Flowing wrap layout.
	LayoutAnchor = widget.LayoutAnchor // Anchor-based absolute positioning within parent.
)
View Source
const (
	AlignStart        = widget.AlignStart        // Align children to the start (left or top).
	AlignCenter       = widget.AlignCenter       // Center children along the axis.
	AlignEnd          = widget.AlignEnd          // Align children to the end (right or bottom).
	AlignSpaceBetween = widget.AlignSpaceBetween // Distribute children with equal space between.
)
View Source
const (
	FillNone   = widget.FillNone   // No stretching.
	FillWidth  = widget.FillWidth  // Stretch to parent's content width.
	FillHeight = widget.FillHeight // Stretch to parent's content height.
	FillBoth   = widget.FillBoth   // Stretch to fill both dimensions.
)
View Source
const (
	Horizontal = widget.Horizontal // Left-to-right orientation.
	Vertical   = widget.Vertical   // Top-to-bottom orientation.
)
View Source
const (
	ModNone  = widget.ModNone  // No modifier keys.
	ModCtrl  = widget.ModCtrl  // Ctrl (or Cmd on macOS).
	ModShift = widget.ModShift // Shift key.
	ModAlt   = widget.ModAlt   // Alt (or Option on macOS).
)
View Source
const (
	// IconLabelBelow places the label beneath the icon (default).
	IconLabelBelow = widget.IconLabelBelow
	// IconLabelRight places the label to the right of the icon.
	IconLabelRight = widget.IconLabelRight
)
View Source
const (
	LabelAbove = widget.LabelAbove // Label is rendered above the input.
	LabelLeft  = widget.LabelLeft  // Label is rendered to the left of the input.

	ValidationNone    = widget.ValidationNone    // No validation state shown.
	ValidationError   = widget.ValidationError   // Field has a validation error.
	ValidationWarning = widget.ValidationWarning // Field has a validation warning.
	ValidationSuccess = widget.ValidationSuccess // Field passed validation.
)
View Source
const (
	TabOverflowClip   = widget.TabOverflowClip   // Clip tabs that overflow the bar width.
	TabOverflowScroll = widget.TabOverflowScroll // Enable horizontal scrolling for overflow tabs.
)
View Source
const (
	AnchorTopLeft      = widget.AnchorTopLeft      // Top-left corner.
	AnchorTopCenter    = widget.AnchorTopCenter    // Top edge, centered horizontally.
	AnchorTopRight     = widget.AnchorTopRight     // Top-right corner.
	AnchorMiddleLeft   = widget.AnchorMiddleLeft   // Left edge, centered vertically.
	AnchorCenter       = widget.AnchorCenter       // Centered in both axes.
	AnchorMiddleRight  = widget.AnchorMiddleRight  // Right edge, centered vertically.
	AnchorBottomLeft   = widget.AnchorBottomLeft   // Bottom-left corner.
	AnchorBottomCenter = widget.AnchorBottomCenter // Bottom edge, centered horizontally.
	AnchorBottomRight  = widget.AnchorBottomRight  // Bottom-right corner.
)
View Source
const (
	NavDrawerLeft  = widget.NavDrawerLeft  // Drawer slides from the left edge.
	NavDrawerRight = widget.NavDrawerRight // Drawer slides from the right edge.
)
View Source
const (
	DragAxisX        = widget.DragAxisX        // Constrain drag to horizontal movement.
	DragAxisY        = widget.DragAxisY        // Constrain drag to vertical movement.
	DragAxisDiagonal = widget.DragAxisDiagonal // Allow free diagonal drag.

	DragGripDots  = widget.DragGripDots  // Render grip as a dot pattern.
	DragGripLines = widget.DragGripLines // Render grip as horizontal lines.
	DragGripNone  = widget.DragGripNone  // No visual grip indicator.
)
View Source
const (
	ImageScaleStretch = widget.ImageScaleStretch // Stretch to fill bounds, ignoring aspect ratio.
	ImageScaleFit     = widget.ImageScaleFit     // Scale to fit within bounds, preserving aspect ratio.
	ImageScaleFill    = widget.ImageScaleFill    // Scale to cover bounds, cropping overflow.
	ImageScaleCenter  = widget.ImageScaleCenter  // Center at original size, no scaling.
	ImageScaleTile    = widget.ImageScaleTile    // Tile the image to fill bounds.
)
View Source
const (
	AnimPlayOnce     = widget.AnimPlayOnce     // Play frames once and stop on the last frame.
	AnimPlayLoop     = widget.AnimPlayLoop     // Loop from the beginning after the last frame.
	AnimPlayPingPong = widget.AnimPlayPingPong // Reverse direction at each end of the sequence.
)
View Source
const (
	TooltipAuto              = widget.TooltipAuto              // Automatically choose the best side.
	TooltipAbove             = widget.TooltipAbove             // Place above the trigger.
	TooltipBelow             = widget.TooltipBelow             // Place below the trigger.
	TooltipLeft              = widget.TooltipLeft              // Place to the left of the trigger.
	TooltipRight             = widget.TooltipRight             // Place to the right of the trigger.
	TooltipCornerTopLeft     = widget.TooltipCornerTopLeft     // Anchor to the trigger's top-left corner.
	TooltipCornerTopRight    = widget.TooltipCornerTopRight    // Anchor to the trigger's top-right corner.
	TooltipCornerBottomLeft  = widget.TooltipCornerBottomLeft  // Anchor to the trigger's bottom-left corner.
	TooltipCornerBottomRight = widget.TooltipCornerBottomRight // Anchor to the trigger's bottom-right corner.
	TooltipFollowMouse       = widget.TooltipFollowMouse       // Follow the mouse cursor.
)

TooltipAnchor constants control tooltip placement relative to the trigger.

View Source
const (
	ColorModeHex   = widget.ColorModeHex   // Hexadecimal color input (#RRGGBB).
	ColorModeRGB   = widget.ColorModeRGB   // RGB sliders (0-255).
	ColorModeHSV   = widget.ColorModeHSV   // Hue/Saturation/Value sliders.
	ColorModeHSL   = widget.ColorModeHSL   // Hue/Saturation/Lightness sliders.
	ColorModeFloat = widget.ColorModeFloat // Floating-point RGB (0.0-1.0).
)
View Source
const (
	ToastBottomRight = widget.ToastBottomRight // Stack toasts in the bottom-right corner.
	ToastBottomLeft  = widget.ToastBottomLeft  // Stack toasts in the bottom-left corner.
	ToastTopRight    = widget.ToastTopRight    // Stack toasts in the top-right corner.
	ToastTopLeft     = widget.ToastTopLeft     // Stack toasts in the top-left corner.
)
View Source
const (
	PopoverBelow = widget.PopoverBelow // Prefer placement below the trigger.
	PopoverAbove = widget.PopoverAbove // Prefer placement above the trigger.
	PopoverRight = widget.PopoverRight // Prefer placement to the right.
	PopoverLeft  = widget.PopoverLeft  // Prefer placement to the left.
)
View Source
const (
	SortAlpha   = widget.SortAlpha   // Alphabetic string comparison.
	SortNumeric = widget.SortNumeric // Numeric comparison.
	SortCustom  = widget.SortCustom  // User-supplied comparison function.

	ClipEllipsis = widget.ClipEllipsis // Truncate overflow text with an ellipsis.
	ClipMask     = widget.ClipMask     // Mask overflow with a clipping rectangle.

	ScrollModeVirtual = widget.ScrollModeVirtual // Only render visible rows (virtualized).
	ScrollModeStatic  = widget.ScrollModeStatic  // Render all rows (no virtualization).

	SelectionModeNone   = widget.SelectionModeNone   // Row selection disabled.
	SelectionModeSingle = widget.SelectionModeSingle // Only one row may be selected.
	SelectionModeMulti  = widget.SelectionModeMulti  // Multiple rows may be selected.

	SortNone = widget.SortNone // Column is unsorted.
	SortAsc  = widget.SortAsc  // Ascending sort order.
	SortDesc = widget.SortDesc // Descending sort order.

	OnSortScrollNone        = widget.OnSortScrollNone        // No scroll adjustment after sort.
	OnSortScrollToSelection = widget.OnSortScrollToSelection // Scroll to keep selection visible after sort.
	OnSortScrollToTop       = widget.OnSortScrollToTop       // Scroll to top after sort.
)
View Source
const (
	SortDirAsc  = widget.SortDirAsc  // Ascending sort direction.
	SortDirDesc = widget.SortDirDesc // Descending sort direction.
)
View Source
const (
	SortHandleLeft  = widget.SortHandleLeft  // Drag handle on the left side of each row.
	SortHandleRight = widget.SortHandleRight // Drag handle on the right side of each row.
)
View Source
const (
	// GradientModeH is a horizontal gradient (TL=BL, TR=BR).
	GradientModeH = widget.GradientModeH
	// GradientModeV is a vertical gradient (TL=TR, BL=BR).
	GradientModeV = widget.GradientModeV
	// GradientModeFourCorner is a 4-corner bilinear gradient (all corners independent).
	GradientModeFourCorner = widget.GradientModeFourCorner
)
View Source
const (
	TimeFormat24h = widget.TimeFormat24h // 24-hour time display (00:00 - 23:59).
	TimeFormat12h = widget.TimeFormat12h // 12-hour time display with AM/PM.
)
View Source
const (
	ToolBarClip   = widget.ToolBarClip   // Clip items that overflow the toolbar bounds.
	ToolBarScroll = widget.ToolBarScroll // Enable scrolling for overflow items.
	ToolBarWrap   = widget.ToolBarWrap   // Wrap overflow items to a new row/column.
)
View Source
const DefaultSharpness = 0.15

DefaultSharpness is the recommended SDF sharpness value for labels.

View Source
const DefaultWindowHeight = widget.DefaultWindowHeight

DefaultWindowHeight is the default height for new windows.

View Source
const DefaultWindowWidth = widget.DefaultWindowWidth

DefaultWindowWidth is the default width for new windows.

View Source
const TreeToggleSize = widget.TreeToggleSize

TreeToggleSize is the width and height (in pixels) of a tree toggle button.

View Source
const Version = "0.2.0"

Version is the current release version of WillowUI.

View Source
const WindowTitleBarHeight = widget.WindowTitleBarHeight

WindowTitleBarHeight is the height of the title bar in pixels.

Variables

View Source
var (
	// ParseMarkup parses XML-like markup into TextSpan slices.
	ParseMarkup = markup.ParseMarkup

	// ParseColor parses a color string in any supported format.
	ParseColor = markup.ParseColor
)
View Source
var (
	// NewColorPropUniform creates a ColorProperty with the same color for all states.
	NewColorPropUniform = theme.NewColorPropUniform
	// NewColorPropStates creates a ColorProperty with per-state colors.
	NewColorPropStates = theme.NewColorPropStates
	// NewSolidBgPropStates creates a BackgroundProperty with per-state solid backgrounds.
	NewSolidBgPropStates = theme.NewSolidBgPropStates
	// NewSolidBgPropUniform creates a BackgroundProperty with the same solid background for all states.
	NewSolidBgPropUniform = theme.NewSolidBgPropUniform
	// NewFloatPropUniform creates a FloatProperty with the same value for all states.
	NewFloatPropUniform = theme.NewFloatPropUniform
	// NewFloatPropStates creates a FloatProperty with per-state values.
	NewFloatPropStates = theme.NewFloatPropStates
)
View Source
var (
	// ParseHex parses a hex color string (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA) into a color.Color.
	ParseHex = colorutil.ParseHex
	// FormatHex formats a color as a #RRGGBB hex string.
	FormatHex = colorutil.FormatHex
	// FormatHexA formats a color as a #RRGGBBAA hex string including alpha.
	FormatHexA = colorutil.FormatHexA
	// ToRGB255 converts a color.Color to 0-255 R, G, B, A components.
	ToRGB255 = colorutil.ToRGB255
	// FromRGB255 creates a color from 0-255 R, G, B, A components.
	FromRGB255 = colorutil.FromRGB255
	// ToHSL converts a color.Color to hue (0-360), saturation (0-1), lightness (0-1).
	ToHSL = colorutil.ToHSL
	// FromHSL creates a color from hue (0-360), saturation (0-1), lightness (0-1).
	FromHSL = colorutil.FromHSL
	// ToHSV converts a color.Color to hue (0-360), saturation (0-1), value (0-1).
	ToHSV = colorutil.ToHSV
	// FromHSV creates a color from hue (0-360), saturation (0-1), value (0-1).
	FromHSV = colorutil.FromHSV
	// NormalizeRGB clamps and converts a color to 0.0-1.0 float64 RGBA components.
	NormalizeRGB = colorutil.NormalizeRGB
)
View Source
var (
	// SampleBilinear returns the bilinearly interpolated color at normalized (u, v).
	SampleBilinear = colorutil.SampleBilinear
	// FormatGradientString returns the theme-compatible JSON fill string for a Gradient.
	FormatGradientString = colorutil.FormatGradientString
	// DefaultGradient returns a horizontal black→white gradient.
	DefaultGradient = colorutil.DefaultGradient
)
View Source
var CollectThemeImages = theme.CollectThemeImages

CollectThemeImages extracts all nine-slice image paths from theme JSON without loading them. Use this for prebaked atlas tooling.

View Source
var CompileXML = template.CompileXML

CompileXML parses XML template data and compiles it to an IR tree.

View Source
var CompileXMLWithTypes = template.CompileXMLWithTypes

CompileXMLWithTypes compiles XML template data, accepting extra custom widget type names.

View Source
var CreateNineSliceNodes = widget.CreateNineSliceNodes

CreateNineSliceNodes builds 9 sprite nodes for a nine-slice background.

View Source
var DecodeIR = template.DecodeIR

DecodeIR decodes a .xmlui binary blob into an IR tree.

View Source
var DefaultColorPickerManager = widget.DefaultColorPickerManager

DefaultColorPickerManager is the package-level color picker manager.

View Source
var DefaultFXAAConfig = sg.DefaultFXAAConfig

DefaultFXAAConfig returns an FXAAConfig with FXAA 3.11 quality-15 defaults.

View Source
var DefaultFocusManager = widget.DefaultFocusManager

DefaultFocusManager is an alias for FM (backwards compatibility).

View Source
var DefaultFont *sg.FontFamily

DefaultFont is the default FontFamily. If not set by StageConfig.Font or directly, Setup auto-loads the embedded Go font bundle.

View Source
var DefaultMenuPopupManager = widget.DefaultMenuPopupManager

DefaultMenuPopupManager is the package-level menu popup manager.

View Source
var DefaultPopoverManager = widget.DefaultPopoverManager

DefaultPopoverManager is the package-level singleton used by all Popover instances.

View Source
var DefaultScheduler = &reactive.DefaultScheduler

DefaultScheduler is the package-level scheduler. It points into the internal reactive package so that Ref.Set() and Computed.markDirty() enqueue to the same scheduler that external callers flush.

View Source
var DefaultTheme = theme.DefaultTheme

DefaultTheme is the fallback theme used when no explicit theme is set. This is the canonical variable; theme.DefaultThemeRef is redirected here at init time so that widget.EffectiveTheme() always reads from this variable.

View Source
var DefaultToastManager = widget.DefaultToastManager

DefaultToastManager is the package-level singleton used by ShowToast.

View Source
var DefaultTooltipManager = widget.DefaultTooltipManager

DefaultTooltipManager is the package-level tooltip manager. Set DefaultTooltipManager.Enabled = false to disable all tooltips globally.

View Source
var DefaultWindowManager = widget.DefaultWindowManager

DefaultWindowManager is the package-level default window manager instance.

View Source
var EllipsisLabel = widget.EllipsisLabel

EllipsisLabel creates a Label for use in cell rendering.

View Source
var EmbeddedGoFont = embeddedGoFont

EmbeddedGoFont is the raw bytes of the embedded Go font bundle (Regular + Bold + Italic + BoldItalic). Pass to willow.NewFontFamilyFromFontBundle to create a FontFamily manually, or use MustLoadDefaultFont for convenience.

View Source
var EncodeIR = template.EncodeIR

EncodeIR encodes an IR tree into a .xmlui binary blob.

View Source
var EncodeThemeBinary = theme.EncodeThemeBinary

EncodeThemeBinary encodes theme JSON, atlas JSON, and atlas PNG into the WUIT binary format. Use the themec CLI tool for full compilation.

View Source
var EvalExpression = template.EvalExpression

EvalExpression evaluates an expression AST node in the given context.

FM is the package-level FocusManager singleton. UI widgets and the screen system use this for focus dispatch, hotkeys, and navigation.

View Source
var GradientBackground = core.GradientBackground

GradientBackground creates a gradient background.

Input is the package-level InputManager singleton. Game logic reads key state through this instead of ebiten directly.

View Source
var Key = widget.Key

Key creates a KeyCombo from a key and modifier mask.

View Source
var LabelColumn = widget.LabelColumn

LabelColumn creates a simple text-label column with the given key, header and accessor.

View Source
var LayoutNineSlice = widget.LayoutNineSlice

LayoutNineSlice positions and scales the 9 sprites of a nine-slice.

View Source
var LerpColor = widget.LerpColor

LerpColor linearly interpolates between two colors.

View Source
var LoadTheme = theme.LoadTheme

LoadTheme parses JSON theme data and produces a *Theme. Returns an error if validation fails (bad colors, missing required groups, etc.). Nine-slice images are rejected — use LoadThemeFromFile or LoadThemeFromFS.

View Source
var LoadThemeBinary = theme.LoadThemeBinary

LoadThemeBinary decodes a WUIT binary (.theme file) and compiles the theme. The atlas (if present) is decoded from the embedded PNG + JSON sections.

View Source
var LoadThemeFromFS = func(fsys fs.FS, path string) (*Theme, error) {
	return theme.LoadThemeFromFS(fsys, path)
}

LoadThemeFromFS reads a JSON file from an fs.FS and compiles the theme. Nine-slice image paths are resolved within the FS.

View Source
var LoadThemeFromFile = theme.LoadThemeFromFile

LoadThemeFromFile reads a JSON file and compiles the theme. Nine-slice image paths are resolved relative to the JSON file's directory.

View Source
var MeterColumn = widget.MeterColumn

MeterColumn creates a column that renders an inline MeterBar for each row. The accessor returns a float64 in [0, 1]. Use Cell.OnPostUpdate to customize the fill color dynamically.

View Source
var NewAccordion = widget.NewAccordion

NewAccordion creates an Accordion with default settings.

View Source
var NewAnchorLayout = widget.NewAnchorLayout

NewAnchorLayout creates an AnchorLayout container.

View Source
var NewAnimatedImage = widget.NewAnimatedImage

NewAnimatedImage creates an AnimatedImage widget with no frames set.

View Source
var NewBadge = widget.NewBadge

NewBadge creates a Badge with the given name, font, and display size.

View Source
var NewButton = widget.NewButton

NewButton creates a Button with the given name, text label, font, and display size.

View Source
var NewCalendarSelector = widget.NewCalendarSelector

NewCalendarSelector creates a CalendarSelector with today's date selected.

View Source
var NewCheckbox = widget.NewCheckbox

NewCheckbox creates a Checkbox with the given label text, font, and display size.

View Source
var NewColorPicker = widget.NewColorPicker

NewColorPicker creates a ColorPicker trigger.

View Source
var NewComponent = widget.NewComponent

NewComponent creates a new Component with sensible defaults.

View Source
var NewContextMenu = widget.NewContextMenu

NewContextMenu creates a ContextMenu with the given font and display size.

View Source
var NewDataTable = widget.NewDataTable

NewDataTable creates a DataTable with the given name and row height.

View Source
var NewDragHandle = widget.NewDragHandle

NewDragHandle creates a DragHandle with default dot grip style.

View Source
var NewFlow = widget.NewFlow

NewFlow creates a Component with LayoutFlow pre-configured.

View Source
var NewFocusManager = widget.NewFocusManager

NewFocusManager creates an empty focus manager.

View Source
var NewGradientEditor = widget.NewGradientEditor

NewGradientEditor creates a new GradientEditor with the given name, font, and display size.

View Source
var NewHBox = widget.NewHBox

NewHBox creates a Component with LayoutHBox pre-configured.

View Source
var NewHotReloader = dev.NewHotReloader

NewHotReloader creates a hot reloader that watches xmlPath for changes and recompiles the template, swapping the live component tree on the screen.

View Source
var NewHotReloaderDirect = dev.NewHotReloaderDirect

NewHotReloaderDirect creates a HotReloader without starting a file watcher. Intended for unit tests that call Reload() directly.

View Source
var NewIconButton = widget.NewIconButton

NewIconButton creates an icon-first button. Call SetIconImage or SetIconKey to provide an icon source.

View Source
var NewImage = widget.NewImage

NewImage creates an Image widget with no source set.

View Source
var NewImageCropper = widget.NewImageCropper

NewImageCropper creates an ImageCropper widget.

View Source
var NewInputField = widget.NewInputField

NewInputField creates a new InputField with the given name, font, and display size.

View Source
var NewInputManager = widget.NewInputManager

NewInputManager creates an isolated InputManager (primarily for tests).

View Source
var NewKeybindInput = widget.NewKeybindInput

NewKeybindInput creates a KeybindInput with the given name, font, and display size.

View Source
var NewLabel = widget.NewLabel

NewLabel creates a Label with the given name, initial text, font, and display size.

View Source
var NewList = widget.NewList

NewList creates a scrollable list with the given item height.

View Source
var NewMaskedInput = widget.NewMaskedInput

NewMaskedInput creates a single-line masked input with the given font and display size.

View Source
var NewMenuBar = widget.NewMenuBar

NewMenuBar creates a new MenuBar with the given font and display size.

View Source
var NewMenuPopup = widget.NewMenuPopup

NewMenuPopup creates a MenuPopup that will display items using font at displaySize.

View Source
var NewMeterBar = widget.NewMeterBar

NewMeterBar creates a MeterBar with range [0, 1].

View Source
var NewNavDrawer = widget.NewNavDrawer

NewNavDrawer creates a NavDrawer anchored to the left edge by default.

View Source
var NewNumberStepper = widget.NewNumberStepper

NewNumberStepper creates a NumberStepper with range (-∞, +∞), step 1, and zero decimal places.

View Source
var NewOptionRotator = widget.NewOptionRotator

NewOptionRotator creates an OptionRotator with the given name, options list, font, and display size. Panics if options is empty.

View Source
var NewPanel = widget.NewPanel

NewPanel creates a Panel with no background and no border.

View Source
var NewPopover = widget.NewPopover

NewPopover creates a new Popover with the given name.

View Source
var NewProgressBar = widget.NewProgressBar

NewProgressBar creates a MeterBar with range [0, 1]. Alias for NewMeterBar.

View Source
var NewRadio = widget.NewRadio

NewRadio creates a new empty Radio widget.

View Source
var NewReactiveTreeNode = widget.NewReactiveTreeNode

NewReactiveTreeNode creates a ReactiveTreeNode with an empty Children array.

View Source
var NewRichText = widget.NewRichText

NewRichText creates a RichText component with the given font and display size.

View Source
var NewScreen = widget.NewScreen

NewScreen creates a new Screen. Options: WithController, WithScene.

View Source
var NewScrollBar = widget.NewScrollBar

NewScrollBar creates a ScrollBar.

View Source
var NewScrollPanel = widget.NewScrollPanel

NewScrollPanel creates a ScrollPanel.

View Source
var NewSearchBox = widget.NewSearchBox

NewSearchBox creates a SearchBox with the given name, font, and display size.

View Source
var NewSelect = widget.NewSelect

NewSelect creates a Select with the given name, options list, font, and display size.

View Source
var NewSlider = widget.NewSlider

NewSlider creates a horizontal slider with range [0, 1].

View Source
var NewSortableList = widget.NewSortableList

NewSortableList creates a new sortable list with fixed item height.

View Source
var NewSortableTreeList = widget.NewSortableTreeList

NewSortableTreeList creates a new sortable tree list.

View Source
var NewSpacer = widget.NewSpacer

NewSpacer creates an invisible fixed-size gap for use in VBox/HBox layouts. It occupies layout space without rendering anything.

View Source
var NewStageManager = widget.NewStageManager

NewStageManager creates an isolated StageManager. Intended for testing; production code uses ui.Stage.

View Source
var NewStatWeb = widget.NewStatWeb

NewStatWeb creates a StatWeb with the given name, font, and font size.

View Source
var NewTabBar = widget.NewTabBar

NewTabBar creates a TabBar with the given font and display size.

View Source
var NewTag = widget.NewTag

NewTag creates a Tag with the given name, font, and display size.

View Source
var NewTagBar = widget.NewTagBar

NewTagBar creates a TagBar with the given name, font, and display size.

View Source
var NewTemplateRegistry = template.NewTemplateRegistry

NewTemplateRegistry creates a new template registry.

View Source
var NewTemplateRegistryWithFont = template.NewTemplateRegistryWithFont

NewTemplateRegistryWithFont creates a new template registry with a default font loaded from raw TTF data and a display font size.

View Source
var NewTextArea = widget.NewTextArea

NewTextArea creates a multi-line text area with the given font and display size.

View Source
var NewTextInput = widget.NewTextInput

NewTextInput creates a single-line text input with the given font and display size.

View Source
var NewTileList = widget.NewTileList

NewTileList creates a scrollable tile list with the given tile dimensions.

View Source
var NewTimePicker = widget.NewTimePicker

NewTimePicker creates a TimePicker with default 24h format, no seconds.

View Source
var NewToggle = widget.NewToggle

NewToggle creates a Toggle switch with default dimensions.

View Source
var NewToggleButtonBar = widget.NewToggleButtonBar

NewToggleButtonBar creates a ToggleButtonBar with the given font and display size.

View Source
var NewToolBar = widget.NewToolBar

NewToolBar creates a new ToolBar with horizontal orientation and clip overflow.

View Source
var NewToolGroup = widget.NewToolGroup

NewToolGroup creates a new ToolGroup for radio-style icon button selection.

View Source
var NewTooltip = widget.NewTooltip

NewTooltip creates a Tooltip with sensible defaults.

View Source
var NewTreeList = widget.NewTreeList

NewTreeList creates a TreeList with the given item height.

View Source
var NewTreeTable = widget.NewTreeTable

NewTreeTable creates a new TreeTable with the given name, font, and display size.

View Source
var NewTreeToggle = widget.NewTreeToggle

NewTreeToggle creates a toggle button for expanding/collapsing a tree node.

View Source
var NewTwoColumnLayout = widget.NewTwoColumnLayout

NewTwoColumnLayout creates a TwoColumnLayout container with sensible defaults: left column right-aligned, right column left-aligned, 12px gap, 8px row spacing.

View Source
var NewVBox = widget.NewVBox

NewVBox creates a Component with LayoutVBox pre-configured.

View Source
var NewWindow = widget.NewWindow

NewWindow creates a Window with the given title, font, and display size.

View Source
var NewWindowManager = widget.NewWindowManager

NewWindowManager creates a new window manager.

View Source
var ParseExpression = template.ParseExpression

ParseExpression parses an expression string into an AST.

View Source
var PasswordDotGlyph = widget.PasswordDotGlyph

PasswordDotGlyph returns the procedural dot glyph used for password masking.

View Source
var RoundedRectBorderMesh = widget.RoundedRectBorderMesh

RoundedRectBorderMesh builds a mesh for a rounded rectangle border.

View Source
var RoundedRectGradientMesh = widget.RoundedRectGradientMesh

RoundedRectGradientMesh builds a gradient-filled rounded rectangle mesh.

View Source
var RoundedRectPoints = widget.RoundedRectPoints

RoundedRectPoints returns the outline points for a rounded rectangle.

View Source
var SelectionColumn = widget.SelectionColumn

SelectionColumn creates a column that renders checkboxes (multi-select) or radio dots (single-select) per row. Visibility and mode are controlled by reactive Refs so external UI can toggle batch mode dynamically.

View Source
var SetRowClickSelects = widget.SetRowClickSelects

SetRowClickSelects configures whether clicking anywhere on a row triggers the selection toggle for a SelectionColumn.

View Source
var ShowToast = widget.ShowToast

ShowToast shows a toast via DefaultToastManager with the given variant.

View Source
var SliceBackground = core.SliceBackground

SliceBackground creates a nine-slice background.

View Source
var SolidBackground = core.SolidBackground

SolidBackground creates a solid-color background.

Stage is the package-level screen-stack singleton. Add, remove, and replace screens here; the scene is wired automatically by Setup.

View Source
var SubRegion = widget.SubRegion

SubRegion extracts a sub-region from a texture atlas region.

View Source
var UpdateEllipsisLabel = widget.UpdateEllipsisLabel

UpdateEllipsisLabel updates the text of an EllipsisLabel component.

View Source
var ValidateTheme = theme.ValidateTheme

ValidateTheme checks that the given theme defines configs for all the named component types. Returns an error listing any missing configs.

View Source
var WithController = widget.WithController

WithController attaches a Controller to the screen.

View Source
var WithDismissOnClick = widget.WithDismissOnClick

WithDismissOnClick enables or disables click-to-dismiss (default true).

View Source
var WithDuration = widget.WithDuration

WithDuration sets the auto-dismiss duration.

View Source
var WithOnDismiss = widget.WithOnDismiss

WithOnDismiss sets a callback invoked when the toast is dismissed.

View Source
var WithProgress = widget.WithProgress

WithProgress shows a shrinking remaining-time bar at the bottom of the toast.

View Source
var WithScene = widget.WithScene

WithScene sets the scene on a Screen explicitly. Intended for use in tests; in production the scene is set automatically by Stage.Add.

Functions

func ArrayMap

func ArrayMap[T, U any](a *Array[T], fn func(T) U) []U

ArrayMap transforms each element of a using fn and returns a plain []U.

func ArrayReduce

func ArrayReduce[T, U any](a *Array[T], fn func(U, T) U, init U) U

ArrayReduce folds a into a single U value using fn, starting from init.

func ArraySort

func ArraySort[T interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
		~float32 | ~float64 | ~string
}](a *Array[T])

ArraySort sorts a in ascending order. T must satisfy cmp.Ordered.

func ArraySortDesc

func ArraySortDesc[T interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
		~float32 | ~float64 | ~string
}](a *Array[T])

ArraySortDesc sorts a in descending order. T must satisfy cmp.Ordered.

func ArraySortFold

func ArraySortFold[T any](a *Array[T], key func(T) string)

ArraySortFold sorts a case-insensitively using key to extract a string from each element. Comparison uses Unicode simple case-folding so "Abc" == "abc" == "ABC".

func BindFormatter

func BindFormatter[T comparable](source *Ref[T]) (*Ref[string], WatchHandle)

BindFormatter returns a *Ref[string] that stays in sync with source, converting values via fmt.Sprint. Use with BindText.

The returned WatchHandle must be stopped when the binding is no longer needed. Pass it to screen.TrackRef or call h.Stop() explicitly.

func BindFormatterf

func BindFormatterf[T comparable](source *Ref[T], format string) (*Ref[string], WatchHandle)

BindFormatterf returns a *Ref[string] that stays in sync with source, converting values via fmt.Sprintf. Use with BindText.

The returned WatchHandle must be stopped when the binding is no longer needed. Pass it to screen.TrackRef or call h.Stop() explicitly.

func BindSortableListItems

func BindSortableListItems[T any](sl *SortableList, items *Array[T])

BindSortableListItems binds a reactive Array[T] to a SortableList.

func Includes

func Includes[T comparable](a *Array[T], item T) bool

Includes reports whether item is present in a.

func Increment

func Increment[T Numeric](r *Ref[T], delta T) func()

Increment returns a func() that adds delta to a numeric ref.

func IndexOf

func IndexOf[T comparable](a *Array[T], item T) int

IndexOf returns the index of item in a, or -1 if absent.

func MustLoadDefaultFont

func MustLoadDefaultFont() *sg.FontFamily

MustLoadDefaultFont loads the embedded Go font bundle into DefaultFont and returns it. If DefaultFont is already loaded, it returns the existing value. This is intended for use in examples that need a font before ui.Setup runs. Panics on load failure.

func NewDivider

func NewDivider(name string, width float64) *sg.Node

NewDivider creates a horizontal rule sprite styled with the standard divider color. Position it with SetPosition and add it to a node with AddChild.

func NewSectionLabel

func NewSectionLabel(name, text string, source *sg.FontFamily, size float64) *widget.Label

NewSectionLabel creates a Label pre-styled as a muted section header using the standard dim blue-grey palette common across WillowUI example layouts.

func Set

func Set[T comparable](r *Ref[T], val T) func()

Set returns a func() that sets a ref to the given value.

func SetScene

func SetScene(s *sg.Scene)

SetScene registers the active scene so UI components can read injected keyboard input from test runners. The most recently registered non-nil scene is retained as a fallback when active scene is nil.

func SetSearchBoxFunc

func SetSearchBoxFunc[T any](sb *SearchBox, results *Array[T], fn func(query string) []T)

SetSearchBoxFunc configures the SearchBox with an automatic search callback that returns a slice. Results replace the bound reactive Array on each search.

func SetSearchBoxIntoFunc

func SetSearchBoxIntoFunc[T any](sb *SearchBox, results *Array[T], fn func(query string, results *Array[T]))

SetSearchBoxIntoFunc configures the SearchBox with an advanced search callback that directly mutates the bound reactive Array.

func SetUpdateFunc

func SetUpdateFunc(scene *sg.Scene, fn func() error)

SetUpdateFunc wraps fn and sets it as the scene's per-frame update function. The reactive scheduler is automatically flushed at the start of each frame before fn runs, so Ref.Set() calls made inside event callbacks (OnClick, etc.) propagate to watchers and bound widgets within the same frame — no manual DefaultScheduler.Flush() required.

func Setup

func Setup(cfg StageConfig, components ...UIElement)

Setup configures the application window, creates the internal scene, and starts the game loop. Setup never returns; errors are printed to stderr and the process exits.

When components are passed, Setup creates a Screen, adds them to it, and pushes it onto the Stage automatically — no manual Screen/Stage wiring needed.

func ToggleRef

func ToggleRef(r *Ref[bool]) func()

ToggleRef returns a func() that flips a boolean ref.

Types

type Accordion

type Accordion = widget.Accordion

Accordion is a vertically stacked list of collapsible sections, each with a header row and an arbitrary content panel.

type AccordionConfig

type AccordionConfig = theme.AccordionConfig

AccordionConfig maps variant names to AccordionGroup.

type AccordionGroup

type AccordionGroup = theme.AccordionGroup

AccordionGroup holds theme properties for Accordion variants.

type AccordionSection

type AccordionSection = widget.AccordionSection

AccordionSection defines a section to add to an Accordion.

type Alignment

type Alignment = widget.Alignment

Alignment controls child positioning.

type Anchor

type Anchor = widget.Anchor

Anchor identifies a position within a parent container.

type AnchorLayout

type AnchorLayout = widget.AnchorLayout

AnchorLayout is a container that pins children to edges or corners of the parent with pixel offsets. The primary tool for HUD composition.

type AnimPlayMode

type AnimPlayMode = widget.AnimPlayMode

AnimPlayMode controls how an AnimatedImage loops.

type AnimatedImage

type AnimatedImage = widget.AnimatedImage

AnimatedImage extends Image to play back a frame-strip sprite animation, cycling through regions at a configurable FPS.

type AnimatedImageConfig

type AnimatedImageConfig = theme.AnimatedImageConfig

AnimatedImageConfig maps variant names to AnimatedImageGroup.

type AnimatedImageGroup

type AnimatedImageGroup = theme.AnimatedImageGroup

AnimatedImageGroup holds theme properties for AnimatedImage variants.

type Array

type Array[T any] = reactive.Array[T]

Array[T] is a reactive ordered collection — re-exported from internal/reactive.

func NewArray

func NewArray[T any]() *Array[T]

NewArray creates an empty reactive array.

func NewArrayFrom

func NewArrayFrom[T any](items []T) *Array[T]

NewArrayFrom creates a reactive array copied from the given slice.

func NewArrayFromAny

func NewArrayFromAny[T any](items []T) *Array[any]

NewArrayFromAny creates a reactive Array[any] from a typed slice, boxing each element.

func NewArrayWithCap

func NewArrayWithCap[T any](cap int) *Array[T]

NewArrayWithCap creates an empty reactive array with the given initial capacity.

type AttrSetter

type AttrSetter = template.AttrSetter

AttrSetter applies a named attribute value to a custom widget component.

type Background

type Background = core.Background

Background describes how to render a component's background.

type BackgroundProperty

type BackgroundProperty = theme.BackgroundProperty

BackgroundProperty holds a background value for each component state.

type BackgroundType

type BackgroundType = core.BackgroundType

BackgroundType tags the kind of background rendering.

type Badge

type Badge = widget.Badge

Badge is a small pill or dot overlay for counts, labels, or status indicators.

type BadgeConfig

type BadgeConfig = theme.BadgeConfig

BadgeConfig maps variant names to BadgeGroup.

type BadgeGroup

type BadgeGroup = theme.BadgeGroup

BadgeGroup holds theme properties for Badge variants.

type BinOp

type BinOp = template.BinOp

BinOp identifies a binary operator.

const (
	BinAdd BinOp = template.BinAdd // Addition (+).
	BinSub BinOp = template.BinSub // Subtraction (-).
	BinMul BinOp = template.BinMul // Multiplication (*).
	BinDiv BinOp = template.BinDiv // Division (/).
	BinMod BinOp = template.BinMod // Modulo (%).
	BinEq  BinOp = template.BinEq  // Equality (==).
	BinNeq BinOp = template.BinNeq // Inequality (!=).
	BinLt  BinOp = template.BinLt  // Less than (<).
	BinLte BinOp = template.BinLte // Less than or equal (<=).
	BinGt  BinOp = template.BinGt  // Greater than (>).
	BinGte BinOp = template.BinGte // Greater than or equal (>=).
	BinAnd BinOp = template.BinAnd // Logical AND (&&).
	BinOr  BinOp = template.BinOr  // Logical OR (||).
)

type BindHandle

type BindHandle = widget.BindHandle

BindHandle identifies a registered keybind for later removal.

type Button

type Button = widget.Button

Button is an interactive component with a colored background and centered text label.

type ButtonConfig

type ButtonConfig = theme.ButtonConfig

ButtonConfig maps variant names to ButtonGroup.

type ButtonGroup

type ButtonGroup = theme.ButtonGroup

ButtonGroup holds theme properties for Button variants.

type CalendarSelector

type CalendarSelector = widget.CalendarSelector

CalendarSelector is a month-grid date picker with prev/next month navigation.

type CalendarSelectorConfig

type CalendarSelectorConfig = theme.CalendarSelectorConfig

CalendarSelectorConfig maps variant names to CalendarSelectorGroup.

type CalendarSelectorGroup

type CalendarSelectorGroup = theme.CalendarSelectorGroup

CalendarSelectorGroup holds theme properties for CalendarSelector variants.

type CellClipMode

type CellClipMode = widget.CellClipMode

CellClipMode controls how cell content is clipped when it overflows.

type CellCoord

type CellCoord = widget.CellCoord

CellCoord identifies a cell by row and column index.

type CellStyle

type CellStyle = widget.CellStyle

CellStyle holds styling overrides and hooks for DataTable cells and headers.

type Checkbox

type Checkbox = widget.Checkbox

Checkbox is a toggle control with a box and check mark.

type CheckboxConfig

type CheckboxConfig = theme.CheckboxConfig

CheckboxConfig maps variant names to CheckboxGroup.

type CheckboxGroup

type CheckboxGroup = theme.CheckboxGroup

CheckboxGroup holds theme properties for Checkbox variants.

type ColorMode

type ColorMode = widget.ColorMode

ColorMode selects which input mode the picker popup displays.

type ColorPicker

type ColorPicker = widget.ColorPicker

ColorPicker is a swatch + label trigger that opens a floating picker popup.

type ColorPickerConfig

type ColorPickerConfig = theme.ColorPickerConfig

ColorPickerConfig maps variant names to ColorPickerGroup.

type ColorPickerGroup

type ColorPickerGroup = theme.ColorPickerGroup

ColorPickerGroup holds theme properties for ColorPicker variants.

type ColorPickerManager

type ColorPickerManager = widget.ColorPickerManager

ColorPickerManager manages the single active floating color picker popup.

type ColorProperty

type ColorProperty = theme.ColorProperty

ColorProperty holds a color value for each component state.

type Component

type Component = widget.Component

Component is the base type for all WillowUI widgets.

type ComponentState

type ComponentState = core.ComponentState

ComponentState represents the visual state of a component.

type Computed

type Computed[T comparable] = reactive.Computed[T]

Computed is a reactive computed value — re-exported from internal/reactive.

func NewComputed

func NewComputed[T comparable](fn func() T) *Computed[T]

NewComputed creates a new computed reactive value.

type Config

type Config[G any] = theme.Config[G]

Config is a generic component config with variant group support.

type ContextMenu

type ContextMenu = widget.ContextMenu

ContextMenu is a list of items shown on right-click.

type Controller

type Controller = widget.Controller

Controller is implemented by per-screen state owners.

type DataProvider

type DataProvider = template.DataProvider

DataProvider is implemented by controllers that support XML template data binding.

type DataTable

type DataTable = widget.DataTable

DataTable is a virtualized, sortable, filterable data grid widget.

type DataTableColumn

type DataTableColumn = widget.DataTableColumn

DataTableColumn defines a column in a DataTable.

type DataTableConfig

type DataTableConfig = theme.DataTableConfig

DataTableConfig maps variant names to DataTableGroup.

type DataTableGroup

type DataTableGroup = theme.DataTableGroup

DataTableGroup holds theme properties for DataTable variants.

type DataTableScrollMode

type DataTableScrollMode = widget.ScrollMode

DataTableScrollMode controls how the DataTable scrolls. Note: named DataTableScrollMode to avoid conflict with existing types.

type DataTableSelectionMode

type DataTableSelectionMode = widget.SelectionMode

DataTableSelectionMode controls row selection behavior in a DataTable.

type DirectiveType

type DirectiveType = template.DirectiveType

DirectiveType identifies a structural directive in a compiled template.

const (
	DirectiveIf   DirectiveType = template.DirectiveIf   // Conditional rendering (if:expr).
	DirectiveFor  DirectiveType = template.DirectiveFor  // List rendering (for:item in collection).
	DirectiveShow DirectiveType = template.DirectiveShow // Visibility toggle (show:expr).
)

type DragAxis

type DragAxis = widget.DragAxis

DragAxis specifies which axis a DragHandle operates on.

type DragGripStyle

type DragGripStyle = widget.DragGripStyle

DragGripStyle specifies the visual indicator rendered on a DragHandle.

type DragHandle

type DragHandle = widget.DragHandle

DragHandle is a visible grip primitive that emits drag delta events and can optionally resize a target component directly.

type DragHandleConfig

type DragHandleConfig = theme.DragHandleConfig

DragHandleConfig maps variant names to DragHandleGroup.

type DragHandleGroup

type DragHandleGroup = theme.DragHandleGroup

DragHandleGroup holds theme properties for DragHandle variants.

type EvalContext

type EvalContext = template.EvalContext

EvalContext provides the evaluation environment for expressions.

type ExprBinary

type ExprBinary = template.ExprBinary

ExprBinary is a binary operation node (e.g. a + b, x == y).

type ExprConcat

type ExprConcat = template.ExprConcat

ExprConcat is a string-interpolation concat node.

type ExprLiteral

type ExprLiteral = template.ExprLiteral

ExprLiteral is a constant value node.

type ExprNode

type ExprNode = template.ExprNode

ExprNode is the interface for all expression AST nodes.

type ExprRef

type ExprRef = template.ExprRef

ExprRef is a data-binding path reference (e.g. "user.name").

type ExprTernary

type ExprTernary = template.ExprTernary

ExprTernary is a ternary conditional node (cond ? then : else).

type ExprUnary

type ExprUnary = template.ExprUnary

ExprUnary is a unary operation node (e.g. !visible, -offset).

type FXAAConfig

type FXAAConfig = sg.FXAAConfig

FXAAConfig holds tunable parameters for the FXAA post-process pass. Use DefaultFXAAConfig for sensible defaults.

func RecommendedFXAAConfig

func RecommendedFXAAConfig() FXAAConfig

RecommendedFXAAConfig returns the moderate FXAA config used by default in Setup — SubpixQuality=0.5, EdgeThreshold=0.275, EdgeThresholdMin=0.0505.

type FactoryContext

type FactoryContext = template.FactoryContext

FactoryContext provides resources needed by component factories.

type FillMode

type FillMode = widget.FillMode

FillMode controls how a component stretches to fill its parent's content area.

type FloatProperty

type FloatProperty = theme.FloatProperty

FloatProperty holds a float64 value for each component state.

type FocusManager

type FocusManager = widget.FocusManager

FocusManager tracks which component has keyboard focus.

type FontSource

type FontSource = *sg.FontFamily

FontSource is a type alias for *sg.FontFamily, kept for backward compatibility. New code should use *sg.FontFamily directly.

type Gradient

type Gradient = widget.Gradient

Gradient is the value type produced by GradientEditor.

type GradientColors

type GradientColors = render.GradientColors

GradientColors defines per-corner colors for gradient backgrounds. It is an alias for render.GradientColors.

type GradientEditor

type GradientEditor = widget.GradientEditor

GradientEditor edits horizontal, vertical, or 4-corner gradients.

type GradientEditorConfig

type GradientEditorConfig = theme.GradientEditorConfig

GradientEditorConfig maps variant names to GradientEditorGroup.

type GradientEditorGroup

type GradientEditorGroup = theme.GradientEditorGroup

GradientEditorGroup holds theme properties for GradientEditor variants.

type GradientMode

type GradientMode = widget.GradientMode

GradientMode selects which corners are independently editable in a GradientEditor.

type HeadingLevel

type HeadingLevel = int

HeadingLevel represents a heading size level for rich text content.

const (
	HeadingNone HeadingLevel = 0 // No heading style.
	Heading1    HeadingLevel = 1 // Largest heading.
	Heading2    HeadingLevel = 2 // Medium heading.
	Heading3    HeadingLevel = 3 // Smallest heading.
)

type HotReloader

type HotReloader = dev.HotReloader

HotReloader watches XML template and JSON theme files, live-reloading when they change. Only available with the "hotreload" build tag.

type IRAttribute

type IRAttribute = template.IRAttribute

IRAttribute represents a single attribute on an IR node.

type IRDirective

type IRDirective = template.IRDirective

IRDirective represents a structural directive attached to an IR node.

type IRNode

type IRNode = template.IRNode

IRNode is the intermediate representation of a compiled XML template element.

type IconButton

type IconButton = widget.IconButton

IconButton is an icon-first button that renders a sprite as its primary content, with an optional text label beneath or beside it.

type IconButtonConfig

type IconButtonConfig = theme.IconButtonConfig

IconButtonConfig maps variant names to IconButtonGroup.

type IconButtonGroup

type IconButtonGroup = theme.IconButtonGroup

IconButtonGroup holds theme properties for IconButton variants.

type IconLabelPosition

type IconLabelPosition = widget.IconLabelPosition

IconLabelPosition controls where the text label appears relative to the icon.

type Image

type Image = widget.Image

Image is a display-only component that renders a sprite, texture region, or engine.Image with configurable fit/fill modes, tinting, and corner radius.

type ImageConfig

type ImageConfig = theme.ImageConfig

ImageConfig maps variant names to ImageGroup.

type ImageCropper

type ImageCropper = widget.ImageCropper

ImageCropper displays an image with a draggable crop rectangle.

type ImageCropperConfig

type ImageCropperConfig = theme.ImageCropperConfig

ImageCropperConfig maps variant names to ImageCropperGroup.

type ImageCropperGroup

type ImageCropperGroup = theme.ImageCropperGroup

ImageCropperGroup holds theme properties for ImageCropper variants.

type ImageGroup

type ImageGroup = theme.ImageGroup

ImageGroup holds theme properties for Image variants.

type ImageScaleMode

type ImageScaleMode = widget.ImageScaleMode

ImageScaleMode controls how the image is laid out within the widget bounds.

type InputField

type InputField = widget.InputField

InputField is a labeled text input that combines a Label, TextInput, and optional validation message into a single composable unit.

type InputManager

type InputManager = widget.InputManager

InputManager reads keyboard state once per frame, tracks consumed keys, and exposes availability queries and event-style listeners for game logic.

type Insets

type Insets = widget.Insets

Insets holds top/right/bottom/left spacing values used for padding and margin.

type KeyBinding

type KeyBinding = widget.KeyBinding

KeyBinding represents a keyboard or gamepad binding.

type KeyCombo

type KeyCombo = widget.KeyCombo

KeyCombo pairs an ebiten key with a modifier mask.

type KeybindInput

type KeybindInput = widget.KeybindInput

KeybindInput is a settings control that captures a keyboard or gamepad binding. It displays the current binding as a styled key cap label and enters listening mode on click to capture a new binding.

type KeybindInputConfig

type KeybindInputConfig = theme.KeybindInputConfig

KeybindInputConfig maps variant names to KeybindInputGroup.

type KeybindInputGroup

type KeybindInputGroup = theme.KeybindInputGroup

KeybindInputGroup holds theme properties for KeybindInput variants.

type Label

type Label = widget.Label

Label is a text display component.

type LabelConfig

type LabelConfig = theme.LabelConfig

LabelConfig maps variant names to LabelGroup.

type LabelGroup

type LabelGroup = theme.LabelGroup

LabelGroup holds theme properties for Label variants.

type LabelPosition

type LabelPosition = widget.LabelPosition

LabelPosition controls where the field label is placed.

type LabelStyle

type LabelStyle = widget.LabelStyle

LabelStyle is a deprecated alias for CellStyle.

type LayoutMode

type LayoutMode = widget.LayoutMode

LayoutMode controls how a Component arranges its children.

type List

type List = widget.List

List is a scrollable list of items.

type ListConfig

type ListConfig = theme.ListConfig

ListConfig maps variant names to ListGroup.

type ListGroup

type ListGroup = theme.ListGroup

ListGroup holds theme properties for List variants.

type ListItem

type ListItem = widget.ListItem

ListItem represents a single item in a List.

type ListenerHandle

type ListenerHandle = widget.ListenerHandle

ListenerHandle identifies a registered key listener for later removal.

type MaskedInput

type MaskedInput = widget.MaskedInput

MaskedInput is a single-line text entry field constrained by a mask pattern.

type MaskedInputConfig

type MaskedInputConfig = theme.MaskedInputConfig

MaskedInputConfig maps variant names to MaskedInputGroup.

type MaskedInputGroup

type MaskedInputGroup = theme.MaskedInputGroup

MaskedInputGroup holds theme properties for MaskedInput variants.

type MenuBar = widget.MenuBar

MenuBar is a horizontal bar of labeled menu buttons that open dropdown panels.

type MenuBarConfig = theme.MenuBarConfig

MenuBarConfig maps variant names to MenuBarGroup.

type MenuBarEntry = widget.MenuBarEntry

MenuBarEntry defines one top-level menu in the bar.

type MenuBarGroup = theme.MenuBarGroup

MenuBarGroup holds theme properties for MenuBar variants.

type MenuItem = widget.MenuItem

MenuItem is a single entry in a MenuPopup.

type MenuPopup = widget.MenuPopup

MenuPopup is a floating list of items shown by MenuPopupManager.

type MenuPopupConfig = theme.MenuPopupConfig

MenuPopupConfig maps variant names to MenuPopupGroup.

type MenuPopupGroup = theme.MenuPopupGroup

MenuPopupGroup holds theme properties for MenuPopup variants.

type MenuPopupManager = widget.MenuPopupManager

MenuPopupManager manages the single active floating menu popup.

type MeterBar

type MeterBar = widget.MeterBar

MeterBar displays a horizontal fill bar for values like HP, mana, or XP.

type MeterBarConfig

type MeterBarConfig = theme.MeterBarConfig

MeterBarConfig maps variant names to MeterBarGroup.

type MeterBarGroup

type MeterBarGroup = theme.MeterBarGroup

MeterBarGroup holds theme properties for MeterBar variants.

type ModifierMask

type ModifierMask = widget.ModifierMask

ModifierMask is a bitmask of modifier keys for keybind registration.

type NavDrawer = widget.NavDrawer

NavDrawer is a slide-out navigation panel anchored to an edge of the screen.

type NavDrawerAnchor = widget.NavDrawerAnchor

NavDrawerAnchor specifies which edge the drawer slides from.

type NavDrawerConfig = theme.NavDrawerConfig

NavDrawerConfig maps variant names to NavDrawerGroup.

type NavDrawerGroup = theme.NavDrawerGroup

NavDrawerGroup holds theme properties for NavDrawer variants.

type NineSlice

type NineSlice = render.NineSlice

NineSlice describes a nine-slice image for use as a component background. It is an alias for render.NineSlice.

type NumberStepper

type NumberStepper = widget.NumberStepper

NumberStepper is a numeric input combining a text field with decrement and increment step buttons.

type Numeric

type Numeric = reactive.Numeric

Numeric is a constraint for types that support arithmetic operations.

type OnSortScroll

type OnSortScroll = widget.OnSortScroll

OnSortScroll controls scroll behavior after a sort operation.

type OptionRotator

type OptionRotator = widget.OptionRotator

OptionRotator is a compact selection widget with left/right chevrons and a centered value label. Clicking the chevrons — or pressing Left/Right arrow keys when focused — cycles through a fixed list of string options.

type OptionRotatorChevronGroup

type OptionRotatorChevronGroup = theme.OptionRotatorChevronGroup

OptionRotatorChevronGroup holds theme properties for OptionRotator chevron arrows.

type OptionRotatorConfig

type OptionRotatorConfig = theme.OptionRotatorConfig

OptionRotatorConfig maps variant names to OptionRotatorGroup.

type OptionRotatorGroup

type OptionRotatorGroup = theme.OptionRotatorGroup

OptionRotatorGroup holds theme properties for OptionRotator variants.

type Orientation

type Orientation = widget.Orientation

Orientation represents horizontal or vertical direction.

type Outline

type Outline = markup.Outline

Outline defines a text stroke rendered behind the fill.

type Panel

type Panel = widget.Panel

Panel is a static container with optional background color, border, and layout.

type PanelConfig

type PanelConfig = theme.PanelConfig

PanelConfig maps variant names to PanelGroup.

type PanelGroup

type PanelGroup = theme.PanelGroup

PanelGroup holds theme properties for Panel variants.

type Popover

type Popover = widget.Popover

Popover is a floating rich-content panel anchored to a trigger component. It is dismissable, interactive, and designed for heavier content than Tooltip.

type PopoverConfig

type PopoverConfig = theme.PopoverConfig

PopoverConfig maps variant names to PopoverGroup.

type PopoverGroup

type PopoverGroup = theme.PopoverGroup

PopoverGroup holds theme properties for Popover variants.

type PopoverManager

type PopoverManager = widget.PopoverManager

PopoverManager manages the single active floating popover.

type PopoverSide

type PopoverSide = widget.PopoverSide

PopoverSide controls which side of the trigger the popover prefers to appear on.

type ProgressBar

type ProgressBar = widget.MeterBar

ProgressBar is an alias for MeterBar.

type PropertyInspectorConfig

type PropertyInspectorConfig = theme.PropertyInspectorConfig

PropertyInspectorConfig maps variant names to PropertyInspectorGroup.

type PropertyInspectorGroup

type PropertyInspectorGroup = theme.PropertyInspectorGroup

PropertyInspectorGroup holds theme properties for PropertyInspector variants.

type Radio

type Radio = widget.Radio

Radio manages a group of mutually exclusive radio buttons.

type RadioButton

type RadioButton = widget.RadioButton

RadioButton is a single option within a Radio widget.

type RadioConfig

type RadioConfig = theme.RadioConfig

RadioConfig maps variant names to RadioGroup.

type RadioGroup

type RadioGroup = theme.RadioGroup

RadioGroup holds theme properties for Radio variants.

type ReactiveTreeNode

type ReactiveTreeNode = widget.ReactiveTreeNode

ReactiveTreeNode is a tree node with a reactive Children array. Use with TreeList.BindRoots so mutations anywhere in the subtree automatically update the tree view.

type Record

type Record = reactive.Record

Record is a reactive key-value object — re-exported from internal/reactive.

func NewRecord

func NewRecord() *Record

NewRecord creates an empty reactive Record.

func NewRecordFrom

func NewRecordFrom(fields map[string]any) *Record

NewRecordFrom creates a reactive Record pre-populated from fields (copied).

type Rect

type Rect = render.Rect

Rect describes a rectangle with position and dimensions. It is an alias for render.Rect.

type Ref

type Ref[T comparable] = reactive.Ref[T]

Ref is a reactive reference — re-exported from internal/reactive.

func NewRef

func NewRef[T comparable](initial T) *Ref[T]

NewRef creates a new reactive reference.

type RichText

type RichText = widget.RichText

RichText is a text display component supporting markup with bold, italic, colors, links, and other inline formatting.

type RichTextConfig

type RichTextConfig = theme.RichTextConfig

RichTextConfig maps variant names to RichTextGroup.

type RichTextEditorConfig

type RichTextEditorConfig = theme.RichTextEditorConfig

RichTextEditorConfig maps variant names to RichTextEditorGroup.

type RichTextEditorGroup

type RichTextEditorGroup = theme.RichTextEditorGroup

RichTextEditorGroup holds theme properties for RichTextEditor variants.

type RichTextGroup

type RichTextGroup = theme.RichTextGroup

RichTextGroup holds theme properties for RichText variants.

type Scheduler

type Scheduler = reactive.Scheduler

Scheduler drives reactive flush cycles.

type Screen

type Screen = widget.Screen

Screen is the unit of UI in WillowUI. It owns a node subtree and an optional controller.

type ScreenOption

type ScreenOption = widget.ScreenOption

ScreenOption configures a Screen during construction.

type ScrollBar

type ScrollBar = widget.ScrollBar

ScrollBar is a scrollbar with a draggable thumb.

type ScrollBarConfig

type ScrollBarConfig = theme.ScrollBarConfig

ScrollBarConfig maps variant names to ScrollBarGroup.

type ScrollBarGroup

type ScrollBarGroup = theme.ScrollBarGroup

ScrollBarGroup holds theme properties for ScrollBar variants.

type ScrollPanel

type ScrollPanel = widget.ScrollPanel

ScrollPanel is a scrollable container panel.

type SearchBox = widget.SearchBox

SearchBox is a search-oriented single-line input with a magnifier icon, optional clear button, debounce, and reactive result population.

type Select

type Select = widget.Select

Select is a dropdown widget that opens a MenuPopup when clicked.

type SelectConfig

type SelectConfig = theme.SelectConfig

SelectConfig maps variant names to SelectGroup.

type SelectGroup

type SelectGroup = theme.SelectGroup

SelectGroup holds theme properties for Select dropdown variants.

type SelectOption

type SelectOption = widget.SelectOption

SelectOption is a single choice in a Select widget.

type ShadowConfig

type ShadowConfig = theme.ShadowConfig

ShadowConfig describes a drop shadow for tooltip components.

type Slider

type Slider = widget.Slider

Slider is a draggable range control for selecting a numeric value.

type SliderConfig

type SliderConfig = theme.SliderConfig

SliderConfig maps variant names to SliderGroup.

type SliderGroup

type SliderGroup = theme.SliderGroup

SliderGroup holds theme properties for Slider variants.

type SortDir

type SortDir = widget.SortDir

SortDir indicates the sort order for a TreeTable column.

type SortDirection

type SortDirection = widget.SortDirection

SortDirection indicates the sort order for a column.

type SortHandleSide

type SortHandleSide = widget.SortHandleSide

SortHandleSide specifies which side of each row the drag handle appears on.

type SortKey

type SortKey = widget.SortKey

SortKey identifies a column and its sort direction in a multi-sort stack.

type SortType

type SortType = widget.SortType

SortType controls how a column's values are compared during sort.

type SortableList

type SortableList = widget.SortableList

SortableList is a vertical list widget specialized for ordered collections with drag-handle-based reordering and keyboard reorder commands.

type SortableListConfig

type SortableListConfig = theme.SortableListConfig

SortableListConfig maps variant names to SortableListGroup.

type SortableListGroup

type SortableListGroup = theme.SortableListGroup

SortableListGroup holds theme properties for SortableList variants.

type SortableTreeItem

type SortableTreeItem = widget.SortableTreeItem

SortableTreeItem represents a node in a sortable tree hierarchy.

type SortableTreeList

type SortableTreeList = widget.SortableTreeList

SortableTreeList is a hierarchical list where nodes can be reordered by drag within their level and optionally reparented by dragging onto another node.

type SortableTreeListConfig

type SortableTreeListConfig = theme.SortableTreeListConfig

SortableTreeListConfig maps variant names to SortableTreeListGroup.

type SortableTreeListGroup

type SortableTreeListGroup = theme.SortableTreeListGroup

SortableTreeListGroup holds theme properties for SortableTreeList variants.

type SpriteRef

type SpriteRef = theme.SpriteRef

SpriteRef holds a resolved texture region from the theme atlas.

type StageConfig

type StageConfig struct {
	Title      string
	Width      int
	Height     int
	ClearColor sg.Color
	// Font, when non-nil, is a *sg.FontFamily used as DefaultFont
	// before any controller OnCreate is called.
	Font *sg.FontFamily
	// FXAA overrides the FXAA post-process configuration. When nil, Setup uses
	// RecommendedFXAAConfig() automatically. Set DisableFXAA to opt out entirely.
	FXAA *FXAAConfig
	// DisableFXAA opts out of the default FXAA pass. Has no effect when FXAA
	// is set explicitly.
	DisableFXAA bool
}

StageConfig holds the window and scene configuration for ui.Setup.

type StageManager

type StageManager = widget.StageManager

StageManager manages a stack of Screens. Use the package-level Stage singleton in application code.

type StatAxis

type StatAxis = widget.StatAxis

StatAxis defines a single spoke on a StatWeb.

type StatWeb

type StatWeb = widget.StatWeb

StatWeb is an editable polygon stat display (spider/radar chart) with named axes and draggable handles for attribute editing.

type StatWebConfig

type StatWebConfig = theme.StatWebConfig

StatWebConfig maps variant names to StatWebGroup.

type StatWebGroup

type StatWebGroup = theme.StatWebGroup

StatWebGroup holds theme properties for StatWeb variants.

type TabBar

type TabBar = widget.TabBar

TabBar is a tab navigation component.

type TabOverflowMode

type TabOverflowMode = widget.TabOverflowMode

TabOverflowMode controls what happens when tabs overflow the bar width.

type TableColumn

type TableColumn = widget.TableColumn

TableColumn defines a column in a TreeTable.

type TabsConfig

type TabsConfig = theme.TabsConfig

TabsConfig maps variant names to TabsGroup.

type TabsGroup

type TabsGroup = theme.TabsGroup

TabsGroup holds theme properties for TabBar variants.

type Tag

type Tag = widget.Tag

Tag is a compact pill widget used as a category marker, filter chip, or item classifier with optional remove and toggle modes.

type TagBar

type TagBar = widget.TagBar

TagBar is a tag-input widget where the user types text and presses Space to create Tag chips. Each tag shows a × to delete it.

type TagBarConfig

type TagBarConfig = theme.TagBarConfig

TagBarConfig maps variant names to TagBarGroup.

type TagBarGroup

type TagBarGroup = theme.TagBarGroup

TagBarGroup holds theme properties for TagBar variants.

type TagConfig

type TagConfig = theme.TagConfig

TagConfig maps variant names to TagGroup.

type TagGroup

type TagGroup = theme.TagGroup

TagGroup holds theme properties for Tag variants.

type TemplateRegistry

type TemplateRegistry = template.TemplateRegistry

TemplateRegistry stores compiled XML templates and instantiates them.

type TextArea

type TextArea = widget.TextArea

TextArea is a multi-line text entry field.

type TextAreaConfig

type TextAreaConfig = theme.TextAreaConfig

TextAreaConfig maps variant names to TextAreaGroup.

type TextAreaGroup

type TextAreaGroup = theme.TextAreaGroup

TextAreaGroup holds theme properties for TextArea variants.

type TextInput

type TextInput = widget.TextInput

TextInput is a single-line text entry field.

type TextInputConfig

type TextInputConfig = theme.TextInputConfig

TextInputConfig maps variant names to TextInputGroup.

type TextInputGroup

type TextInputGroup = theme.TextInputGroup

TextInputGroup holds theme properties for TextInput variants.

type TextSpan

type TextSpan = markup.TextSpan

TextSpan represents a styled segment of text within a RichText component. Fields left at their zero values inherit from the parent RichText.

type Theme

type Theme = theme.Theme

Theme holds the complete visual configuration for all WillowUI components.

func LoadThemeRelative

func LoadThemeRelative(filename string) (*Theme, error)

LoadThemeRelative loads a theme JSON file resolved relative to the caller's source file. This is convenient for examples and tests where the JSON file sits next to the Go source.

type TileList

type TileList = widget.TileList

TileList is a scrollable grid of tile items.

type TileListConfig

type TileListConfig = theme.TileListConfig

TileListConfig maps variant names to TileListGroup.

type TileListGroup

type TileListGroup = theme.TileListGroup

TileListGroup holds theme properties for TileList variants.

type TimeFormat

type TimeFormat = widget.TimeFormat

TimeFormat selects 12-hour or 24-hour time display.

type TimePicker

type TimePicker = widget.TimePicker

TimePicker is a compact hour/minute/second picker with up/down stepper columns and an optional AM/PM toggle.

type TimePickerConfig

type TimePickerConfig = theme.TimePickerConfig

TimePickerConfig maps variant names to TimePickerGroup.

type TimePickerGroup

type TimePickerGroup = theme.TimePickerGroup

TimePickerGroup holds theme properties for TimePicker variants.

type TimeValue

type TimeValue = widget.TimeValue

TimeValue represents a time-of-day as hour (0-23), minute, and second.

type ToastAnchor

type ToastAnchor = widget.ToastAnchor

ToastAnchor specifies which screen corner toasts stack at.

type ToastConfig

type ToastConfig = theme.ToastConfig

ToastConfig maps variant names to ToastGroup.

type ToastGroup

type ToastGroup = theme.ToastGroup

ToastGroup holds theme properties for Toast variants.

type ToastManager

type ToastManager = widget.ToastManager

ToastManager manages a stack of transient toast notifications.

type ToastOption

type ToastOption = widget.ToastOption

ToastOption is a functional option for configuring a toast.

type Toggle

type Toggle = widget.Toggle

Toggle is a binary on/off switch with an animated sliding thumb.

type ToggleButtonBar

type ToggleButtonBar = widget.ToggleButtonBar

ToggleButtonBar is a row of mutually exclusive toggle buttons.

type ToggleButtonBarConfig

type ToggleButtonBarConfig = theme.ToggleButtonBarConfig

ToggleButtonBarConfig maps variant names to ToggleButtonBarGroup.

type ToggleButtonBarGroup

type ToggleButtonBarGroup = theme.ToggleButtonBarGroup

ToggleButtonBarGroup holds theme properties for ToggleButtonBar variants.

type ToggleConfig

type ToggleConfig = theme.ToggleConfig

ToggleConfig maps variant names to ToggleGroup.

type ToggleGroup

type ToggleGroup = theme.ToggleGroup

ToggleGroup holds theme properties for Toggle variants.

type ToolBar

type ToolBar = widget.ToolBar

ToolBar is a horizontal or vertical command strip for housing actions, toggle groups, separators, and compact controls.

type ToolBarConfig

type ToolBarConfig = theme.ToolBarConfig

ToolBarConfig maps variant names to ToolBarGroup.

type ToolBarGroup

type ToolBarGroup = theme.ToolBarGroup

ToolBarGroup holds theme properties for ToolBar variants.

type ToolBarOverflowMode

type ToolBarOverflowMode = widget.ToolBarOverflowMode

ToolBarOverflowMode controls how items behave when they exceed the toolbar's bounds.

type ToolGroup

type ToolGroup = widget.ToolGroup

ToolGroup manages mutually-exclusive selection among a set of IconButtons.

type Tooltip

type Tooltip = widget.Tooltip

Tooltip is a floating overlay that appears after a hover delay. It embeds Component, so all layout, sizing, and child-management methods are available. Tooltips are never added directly to the scene — use SetTooltip on a trigger.

type TooltipAnchor

type TooltipAnchor = widget.TooltipAnchor

TooltipAnchor controls where a tooltip is placed relative to its trigger.

type TooltipConfig

type TooltipConfig = theme.TooltipConfig

TooltipConfig maps variant names to TooltipGroup.

type TooltipGroup

type TooltipGroup = theme.TooltipGroup

TooltipGroup holds theme properties for Tooltip variants.

type TooltipManager

type TooltipManager = widget.TooltipManager

TooltipManager manages tooltip visibility for the scene.

type TreeList

type TreeList = widget.TreeList

TreeList is a collapsible tree view.

type TreeListConfig

type TreeListConfig = theme.TreeListConfig

TreeListConfig maps variant names to TreeListGroup.

type TreeListGroup

type TreeListGroup = theme.TreeListGroup

TreeListGroup holds theme properties for TreeList variants.

type TreeNode

type TreeNode = widget.TreeNode

TreeNode represents a node in a tree hierarchy.

type TreeTable

type TreeTable = widget.TreeTable

TreeTable is a hybrid tree + column grid where rows can be expanded/collapsed while each row spans multiple data columns.

type TreeTableConfig

type TreeTableConfig = theme.TreeTableConfig

TreeTableConfig maps variant names to TreeTableGroup.

type TreeTableGroup

type TreeTableGroup = theme.TreeTableGroup

TreeTableGroup holds theme properties for TreeTable variants.

type TreeTableRow

type TreeTableRow = widget.TreeTableRow

TreeTableRow represents a row in the TreeTable hierarchy.

type TwoColumnLayout

type TwoColumnLayout = widget.TwoColumnLayout

TwoColumnLayout arranges children in labeled two-column rows. Each column is independently aligned. Primary use case is settings screens, stat sheets, and form dialogs.

type UIElement

type UIElement = widget.UIElement

UIElement is implemented by all UI component types in this package.

type UnaryOp

type UnaryOp = template.UnaryOp

UnaryOp identifies a unary operator.

const (
	UnaryNot UnaryOp = template.UnaryNot // Logical negation (!).
	UnaryNeg UnaryOp = template.UnaryNeg // Arithmetic negation (-).
)

type UserConfig

type UserConfig = theme.UserConfig

UserConfig holds a user-defined component configuration with variant support.

type UserGroup

type UserGroup = theme.UserGroup

UserGroup holds the parsed visual properties for a user-defined component variant.

type ValidationState

type ValidationState = widget.ValidationState

ValidationState indicates the current validation status.

type Variant

type Variant = theme.Variant

Variant selects a color group for a component (e.g. Primary, Danger).

type VisualLine

type VisualLine = widget.VisualLine

VisualLine is the exported representation of a visual line for testing.

type WatchHandle

type WatchHandle = reactive.WatchHandle

WatchHandle is a handle returned by WatchEffect / WatchValue.

func WatchEffect

func WatchEffect(fn func()) WatchHandle

WatchEffect creates a reactive effect that re-runs when dependencies change.

func WatchValue

func WatchValue[T comparable](ref *Ref[T], fn func(old, new T)) WatchHandle

WatchValue watches a specific Ref and calls fn with old and new values.

type WidgetFactory

type WidgetFactory = template.WidgetFactory

WidgetFactory creates a custom widget component by name for use in XML templates.

type Window

type Window = widget.Window

Window is a draggable, resizable floating window component.

type WindowConfig

type WindowConfig = theme.WindowConfig

WindowConfig maps variant names to WindowGroup.

type WindowGroup

type WindowGroup = theme.WindowGroup

WindowGroup holds theme properties for Window variants.

type WindowManager

type WindowManager = widget.WindowManager

WindowManager manages multiple floating windows.

Directories

Path Synopsis
cmd
pixelchecker command
themec command
themec is the WillowUI theme compiler and coverage tool.
themec is the WillowUI theme compiler and coverage tool.
xmluic command
xmluic compiles WillowUI assets.
xmluic compiles WillowUI assets.
examples
reactive/array-list command
array-list demonstrates reactive Array bindings on list widgets.
array-list demonstrates reactive Array bindings on list widgets.
reactive/array-select command
array-select demonstrates reactive Array bindings on selection widgets.
array-select demonstrates reactive Array bindings on selection widgets.
reactive/binding-gallery command
binding-gallery demonstrates every widget Bind* method in WillowUI.
binding-gallery demonstrates every widget Bind* method in WillowUI.
reactive/computed-chain command
Computed Chain - reactive demo.
Computed Chain - reactive demo.
reactive/conditional-watch command
Conditional Watch — reactive demo.
Conditional Watch — reactive demo.
reactive/counter command
Counter — minimal reactive example.
Counter — minimal reactive example.
reactive/watch-lifecycle command
Watch Lifecycle - reactive example.
Watch Lifecycle - reactive example.
templating/hotreload command
hotreload demonstrates WillowUI's hot reload feature: edit template.xml while the app is running and see the UI update live.
hotreload demonstrates WillowUI's hot reload feature: edit template.xml while the app is running and see the UI update live.
templating/xml-basic command
xml-basic demonstrates WillowUI's XML template system: a controller that defines its UI via an embedded XML template with reactive bindings, event handlers, and the ui:show directive.
xml-basic demonstrates WillowUI's XML template system: a controller that defines its UI via an embedded XML template with reactive bindings, event handlers, and the ui:show directive.
templating/xml-binary command
xml-binary demonstrates WillowUI's binary template format (.xmlui): the same demo as xml-basic but using a pre-compiled binary template loaded via go:embed and RegisterBinary instead of RegisterXML.
xml-binary demonstrates WillowUI's binary template format (.xmlui): the same demo as xml-basic but using a pre-compiled binary template loaded via go:embed and RegisterBinary instead of RegisterXML.
templating/xml-forms command
xml-forms demonstrates WillowUI's XML template system with form input widgets: TextInput, TextArea, Toggle, Checkbox, Slider, NumberStepper, Select, OptionRotator, and Radio with RadioButton children.
xml-forms demonstrates WillowUI's XML template system with form input widgets: TextInput, TextArea, Toggle, Checkbox, Slider, NumberStepper, Select, OptionRotator, and Radio with RadioButton children.
templating/xml-layout command
xml-layout demonstrates all WillowUI layout modes via a single XML template.
xml-layout demonstrates all WillowUI layout modes via a single XML template.
templating/xml-reactive command
xml-reactive demonstrates every bind: attribute in WillowUI's XML template system.
xml-reactive demonstrates every bind: attribute in WillowUI's XML template system.
templating/xml-variants command
xml-variants demonstrates custom Panel and Label variants defined in a theme JSON file and referenced by name in XML templates.
xml-variants demonstrates custom Panel and Label variants defined in a theme JSON file and referenced by name in XML templates.
theming/font-family command
Font-Family demonstrates loading a custom FontFamily from a .fontbundle and exercising all style variants: regular, bold, italic, bold+italic, multiple display sizes, and RichText with inline markup.
Font-Family demonstrates loading a custom FontFamily from a .fontbundle and exercising all style variants: regular, bold, italic, bold+italic, multiple display sizes, and RichText with inline markup.
theming/macos command
Macos demonstrates a frameless OS window with custom macOS-style chrome built entirely from WillowUI widgets.
Macos demonstrates a frameless OS window with custom macOS-style chrome built entirely from WillowUI widgets.
theming/nineslice command
Nine-slice demonstrates WillowUI nine-slice backgrounds.
Nine-slice demonstrates WillowUI nine-slice backgrounds.
theming/sprite-icons command
Sprite-icons demonstrates WillowUI's theme-driven icon system.
Sprite-icons demonstrates WillowUI's theme-driven icon system.
theming/theme-gallery command
Theme-Gallery demonstrates switching between WillowUI themes at runtime.
Theme-Gallery demonstrates switching between WillowUI themes at runtime.
theming/windows command
Win10 demonstrates a frameless OS window with custom Windows 10-style chrome built entirely from WillowUI widgets.
Win10 demonstrates a frameless OS window with custom Windows 10-style chrome built entirely from WillowUI widgets.
widgets/accordion command
Accordion - collapsible section panels.
Accordion - collapsible section panels.
widgets/anchor-layout command
Anchor layout demonstrates pinning children to edges and corners of a parent container using LayoutAnchor.
Anchor layout demonstrates pinning children to edges and corners of a parent container using LayoutAnchor.
widgets/animated-image command
AnimatedImage widget demo.
AnimatedImage widget demo.
widgets/badge command
Badge demonstrates the WillowUI Badge widget: pill-shaped count/label overlays and dot-mode status indicators with per-variant color presets.
Badge demonstrates the WillowUI Badge widget: pill-shaped count/label overlays and dot-mode status indicators with per-variant color presets.
widgets/buttons command
Buttons demonstrates WillowUI's Label and Button components: reactive text binding, click callbacks, visual states (normal, hovered, disabled), and an IconButton.
Buttons demonstrates WillowUI's Label and Button components: reactive text binding, click callbacks, visual states (normal, hovered, disabled), and an IconButton.
widgets/checkbox-radio command
Checkbox & Radio - reactive demo.
Checkbox & Radio - reactive demo.
widgets/color-picker command
ColorPicker - demonstrates all color input modes.
ColorPicker - demonstrates all color input modes.
widgets/custom-component command
custom-component demonstrates how to build a reusable custom widget and register it for use in XML templates via RegisterWidget.
custom-component demonstrates how to build a reusable custom widget and register it for use in XML templates via RegisterWidget.
widgets/datatable command
DataTable example — character roster demo.
DataTable example — character roster demo.
widgets/datatable-meters command
DataTable meters example — demonstrates MeterColumn with dynamic fill colors.
DataTable meters example — demonstrates MeterColumn with dynamic fill colors.
widgets/datatable-selection command
DataTable SelectionColumn example — email inbox demo.
DataTable SelectionColumn example — email inbox demo.
widgets/drag-handle command
DragHandle - resizable panel demo.
DragHandle - resizable panel demo.
widgets/filter-search command
Filter Search — demo.
Filter Search — demo.
widgets/flow command
Flow layout demonstrates LayoutFlow: children placed left-to-right with automatic row wrapping.
Flow layout demonstrates LayoutFlow: children placed left-to-right with automatic row wrapping.
widgets/focus-gallery command
Focus Gallery demonstrates WillowUI's focus control system: Tab cycling, spatial arrow-key navigation, keyboard activation, and hotkey dispatch across a mixed VBox / HBox / absolute layout.
Focus Gallery demonstrates WillowUI's focus control system: Tab cycling, spatial arrow-key navigation, keyboard activation, and hotkey dispatch across a mixed VBox / HBox / absolute layout.
widgets/forms command
Forms demonstrates WillowUI's form controls: toggle, checkbox, radio group, text input, and text area with reactive bindings and visual states.
Forms demonstrates WillowUI's form controls: toggle, checkbox, radio group, text input, and text area with reactive bindings and visual states.
widgets/gradient-editor command
GradientEditor demonstrates the WillowUI GradientEditor widget: an interactive editor for horizontal, vertical, and 4-corner bilinear gradients.
GradientEditor demonstrates the WillowUI GradientEditor widget: an interactive editor for horizontal, vertical, and 4-corner bilinear gradients.
widgets/image command
Image widget demo.
Image widget demo.
widgets/imagecropper command
ImageCropper widget demo.
ImageCropper widget demo.
widgets/keybindinput command
KeybindInput demonstrates WillowUI's KeybindInput component for capturing keyboard and gamepad bindings in game settings screens.
KeybindInput demonstrates WillowUI's KeybindInput component for capturing keyboard and gamepad bindings in game settings screens.
widgets/labels-buttons command
Labels & Buttons - reactive demo.
Labels & Buttons - reactive demo.
widgets/layout command
Component demonstrates WillowUI's base Component system: layout modes (VBox, HBox, Grid), theming, focus management, dirty flags, and the component lifecycle.
Component demonstrates WillowUI's base Component system: layout modes (VBox, HBox, Grid), theming, focus management, dirty flags, and the component lifecycle.
widgets/list command
List - reactive demo.
List - reactive demo.
widgets/lists command
Lists demonstrates WillowUI's list components: flat list with 1000 items showing virtualization, tile list grid, and tree list with expand/collapse.
Lists demonstrates WillowUI's list components: flat list with 1000 items showing virtualization, tile list grid, and tree list with expand/collapse.
widgets/masked-input command
Masked Input — demo.
Masked Input — demo.
widgets/menubar command
menubar demonstrates a desktop-style menu bar with File, Edit, View, and Help menus.
menubar demonstrates a desktop-style menu bar with File, Edit, View, and Help menus.
widgets/menus command
menus showcases WillowUI's menu system: Select dropdowns, right-click ContextMenus, and programmatically triggered menus.
menus showcases WillowUI's menu system: Select dropdowns, right-click ContextMenus, and programmatically triggered menus.
widgets/modal command
Modal demonstrates WillowUI's modal window mode: a confirmation dialog with a darkened backdrop overlay that blocks all input to the content behind it.
Modal demonstrates WillowUI's modal window mode: a confirmation dialog with a darkened backdrop overlay that blocks all input to the content behind it.
widgets/navdrawer command
NavDrawer - slide-out navigation panel demo.
NavDrawer - slide-out navigation panel demo.
widgets/option-rotator command
OptionRotator demonstrates WillowUI's OptionRotator component: a compact left/right chevron control for cycling through a fixed list of options.
OptionRotator demonstrates WillowUI's OptionRotator component: a compact left/right chevron control for cycling through a fixed list of options.
widgets/popover command
Popover demonstrates WillowUI's Popover widget: a floating interactive panel anchored to a trigger button, dismissed by clicking outside.
Popover demonstrates WillowUI's Popover widget: a floating interactive panel anchored to a trigger button, dismissed by clicking outside.
widgets/ranges command
Ranges demonstrates WillowUI's range controls: slider, scrollbar, progress bar, and meter bar with reactive bindings, drag interaction, and visual states.
Ranges demonstrates WillowUI's range controls: slider, scrollbar, progress bar, and meter bar with reactive bindings, drag interaction, and visual states.
widgets/richtext command
RichText demonstrates WillowUI's RichText component: multi-span styled text with bold, italic, bold+italic variants from a single FontFamily, colors, outlines, word wrapping, and alignment options — all using the span API (AddSpan, AddBoldSpan, AddItalicSpan, AddBoldItalicSpan, AddStyledSpan).
RichText demonstrates WillowUI's RichText component: multi-span styled text with bold, italic, bold+italic variants from a single FontFamily, colors, outlines, word wrapping, and alignment options — all using the span API (AddSpan, AddBoldSpan, AddItalicSpan, AddBoldItalicSpan, AddStyledSpan).
widgets/richtext-markup command
RichTextMarkup demonstrates XML-like markup parsing into WillowUI RichText spans.
RichTextMarkup demonstrates XML-like markup parsing into WillowUI RichText spans.
widgets/richtext-mixed-fonts command
RichText-Mixed-Fonts demonstrates rendering RichText with two different FontFamily instances (Lato sans-serif and Noto Serif) in the same view, mixing them within the same RichText via AddStyledSpan and AddTextSpan.
RichText-Mixed-Fonts demonstrates rendering RichText with two different FontFamily instances (Lato sans-serif and Noto Serif) in the same view, mixing them within the same RichText via AddStyledSpan and AddTextSpan.
widgets/screens command
Screens demonstrates WillowUI's ScreenManager — a navigation stack modelled after mobile app routing.
Screens demonstrates WillowUI's ScreenManager — a navigation stack modelled after mobile app routing.
widgets/scrollbar command
Reactive - ScrollBar: Custom Scroll Area Shows ScrollBar.BindScrollPos with Ref[float64] to wire two external scrollbars to a manually-clipped content viewport — without ScrollPanel.
Reactive - ScrollBar: Custom Scroll Area Shows ScrollBar.BindScrollPos with Ref[float64] to wire two external scrollbars to a manually-clipped content viewport — without ScrollPanel.
widgets/search-dropdown command
Search Dropdown — autocomplete demo.
Search Dropdown — autocomplete demo.
widgets/sliders command
Sliders - reactive demo.
Sliders - reactive demo.
widgets/sortable-list command
SortableList example — demonstrates drag-handle reordering and keyboard reorder commands (Alt+Up / Alt+Down) with a reactive array backing.
SortableList example — demonstrates drag-handle reordering and keyboard reorder commands (Alt+Up / Alt+Down) with a reactive array backing.
widgets/sortable-treelist command
SortableTreeList example — demonstrates a hierarchical list with drag reordering within levels and optional reparenting.
SortableTreeList example — demonstrates a hierarchical list with drag reordering within levels and optional reparenting.
widgets/statweb command
StatWeb demonstrates the WillowUI StatWeb widget: a spider/radar chart for visualizing multi-axis attributes with optional editable handles.
StatWeb demonstrates the WillowUI StatWeb widget: a spider/radar chart for visualizing multi-axis attributes with optional editable handles.
widgets/tabs command
Tabs - reactive demo with scrollable overflow.
Tabs - reactive demo with scrollable overflow.
widgets/tag command
Tag demonstrates the WillowUI Tag and TagBar widgets: pill-shaped category labels with optional remove (×) and toggle modes, plus a tag-input bar where pressing Space creates chips.
Tag demonstrates the WillowUI Tag and TagBar widgets: pill-shaped category labels with optional remove (×) and toggle modes, plus a tag-input bar where pressing Space creates chips.
widgets/text-input command
Text Input - reactive demo.
Text Input - reactive demo.
widgets/tilelist command
TileList - reactive demo.
TileList - reactive demo.
widgets/timepicker command
TimePicker - demonstrates 24h and 12h time pickers with optional seconds.
TimePicker - demonstrates 24h and 12h time pickers with optional seconds.
widgets/toast command
Toast demonstrates WillowUI's Toast notification system: fire-and-forget messages that appear at a screen corner, auto-dismiss, stack, and animate.
Toast demonstrates WillowUI's Toast notification system: fire-and-forget messages that appear at a screen corner, auto-dismiss, stack, and animate.
widgets/toggle command
Toggle - reactive demo.
Toggle - reactive demo.
widgets/toggle-button-bar command
ToggleButtonBar demonstrates WillowUI's ToggleButtonBar component: a segmented control for single-selection among labeled buttons.
ToggleButtonBar demonstrates WillowUI's ToggleButtonBar component: a segmented control for single-selection among labeled buttons.
widgets/toolbar command
ToolBar demonstrates WillowUI's ToolBar with icon buttons in three modes:
ToolBar demonstrates WillowUI's ToolBar with icon buttons in three modes:
widgets/tooltip command
Tooltip demonstrates WillowUI's Tooltip component: hover delays, anchor positions (above, below, right, follow-mouse), rich multi-child content, shared tooltips with dynamic content, programmatic show/hide, and screen-edge clamping that keeps tooltips fully visible.
Tooltip demonstrates WillowUI's Tooltip component: hover delays, anchor positions (above, below, right, follow-mouse), rich multi-child content, shared tooltips with dynamic content, programmatic show/hide, and screen-edge clamping that keeps tooltips fully visible.
widgets/treelist command
TreeList - reactive demo.
TreeList - reactive demo.
widgets/two-column-layout command
TwoColumnLayout demonstrates the full feature set:
TwoColumnLayout demonstrates the full feature set:
widgets/windows command
Windows demonstrates WillowUI's container widgets: Panel, ScrollPanel, and Window with dragging, closing, resizing, and bring-to-front behaviour.
Windows demonstrates WillowUI's container widgets: Panel, ScrollPanel, and Window with dragging, closing, resizing, and bring-to-front behaviour.
internal
dev
sg
scripts
genicons command
genicons generates the default icon spritesheet for WillowUI.
genicons generates the default icon spritesheet for WillowUI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL