Widget catalog

Tree services

Widgets that hand the theme, the window, the words and a place for overlays to the widgets below. gowaku.Run puts each at the root of a window; use them to change a part.

basic.Builder

Builds its content with the BuildContext of its place, to read what is above, such as the theme.

Package github.com/bankai-tensei/gowaku/widgets/basic

basic.Builderbasic.Builder
basic.Builder{Content: func(ctx core.BuildContext) core.Widget {
	th := basic.ThemeOf(ctx)
	return basic.Text{Content: "Builder reads the theme above it", Style: colored(th.Text.Title, th.Color.AccentInk)}
}}

basic.Theme

Gives the widgets below it their look, for a part of the window with another accent.

Package github.com/bankai-tensei/gowaku/widgets/basic

basic.Themebasic.Theme
basic.Builder{Content: func(ctx core.BuildContext) core.Widget {
	green := theme.FromAccent(geom.Hex(0x1f8a5b)).For(basic.MediaQueryOf(ctx).Brightness)
	return basic.Row{Size: layout.MainMin, Spacing: theme.Space16, Children: []core.Widget{
		control.Button{Label: "Window accent", Style: control.ButtonPrimary, OnPress: func() {}},
		basic.Theme{Data: green, Child: basic.Row{Size: layout.MainMin, Spacing: theme.Space8, Children: []core.Widget{
			control.Button{Label: "Green accent", Style: control.ButtonPrimary, OnPress: func() {}},
			control.Switch{Value: true, Label: "Green", OnChange: func(bool) {}},
		}}},
	}}
}}

basic.MediaQuery

Tells the widgets below about the window: brightness, scale, reduced motion, locale and the size of its content area. A widget that reads the size with basic.WindowSizeOf is rebuilt when the window is resized, and only it. Here the British locale starts the week on Monday.

Package github.com/bankai-tensei/gowaku/widgets/basic · Also basic.MediaQueryData

basic.MediaQuerybasic.MediaQuery
basic.Builder{Content: func(ctx core.BuildContext) core.Widget {
	data := basic.MediaQueryOf(ctx)
	data.Locale = language.BritishEnglish // weeks start on Monday
	return basic.MediaQuery{Data: data, Child: field.Calendar{
		Value: time.Date(2026, time.November, 9, 0, 0, 0, 0, time.UTC), OnChange: func(time.Time) {},
	}}
}}

basic.Localizations

Hands the standard widgets the words of their locale. Japanese and English are bundled; add Strings for others.

Package github.com/bankai-tensei/gowaku/widgets/basic · Also basic.Strings

It draws nothing of its own, so there is no picture.

german := &basic.Strings{Language: language.German, Today: "Heute", Clear: "Löschen"}
return basic.Localizations{Strings: []*basic.Strings{german}, Child: field.DatePicker{
	ShowToday: true, ShowClear: true, OnChange: func(time.Time) {},
}}

overlay.Overlay

A place to show entries on top of its child. Dialogs and menus show there too.

Package github.com/bankai-tensei/gowaku/widgets/overlay · Also overlay.Entry, overlay.Host

It draws nothing of its own, so there is no picture.

basic.Builder{Content: func(ctx core.BuildContext) core.Widget {
	return control.Button{Label: "Show a hint", OnPress: func() {
		var entry *overlay.Entry
		entry = overlay.Of(ctx).Insert(func() core.Widget {
			return basic.Positioned{Left: 16, Top: 16, Child: control.Button{Label: "Close the hint", OnPress: func() { entry.Remove() }}}
		})
	}}
}}