Skip to content

Widgets

mike-ward edited this page May 17, 2026 · 1 revision

Widgets

Go-gui ships 50+ built-in widgets organised into seven categories. Every widget factory returns *Layout, which satisfies the View interface, so widgets compose freely — a button can contain an icon, a row, or a whole sub-layout.

All numeric config fields use Opt[T]: a zero value inherits the theme default; pass gui.SomeF(v) (or gui.SomeP(...) for padding) to override selectively. For more on this pattern see Architecture.

For a live, interactive reference run the showcase:

go run ./examples/showcase/

Input

Text fields, date pickers, numeric inputs, and anything the user types into or activates directly.

Widget Factory Description
Button Button(ButtonCfg) Clickable container — holds arbitrary child views
Input Input(InputCfg) Single-line text field; password, phone, expiry masking, multiline
NumericInput NumericInput(NumericInputCfg) Numeric field with locale, currency/percent modes, min/max
Slider Slider(SliderCfg) Min/max range picker
InputDate InputDate(InputDateCfg) Typed date field with embedded picker
ColorPicker ColorPicker(ColorPickerCfg) RGBA color picker with optional HSV view
Form Form(FormCfg) Labelled fields with built-in validation
ThemePicker ThemePicker(ThemePickerCfg) Runtime theme switcher

Input widgets in depth


Selection

Controls for choosing one or more values from a set.

Widget Factory Description
Toggle Toggle(ToggleCfg) Latching toggle button
Checkbox Checkbox(ToggleCfg) Boolean checkbox
Switch Switch(SwitchCfg) On/off toggle switch
Radio Radio(RadioCfg) Single-choice radio button
RadioButtonGroup RadioButtonGroup(RadioButtonGroupCfg) Coordinated radio group
Select Select(SelectCfg) Single or multi-select dropdown
Combobox Combobox(ComboboxCfg) Editable dropdown with typeahead
ListBox ListBox(ListBoxCfg) Scrollable, reorderable list

Selection widgets in depth


Display

Read-only content rendering.

Widget Factory Description
Text Text(TextCfg) Styled text — wrapping, gradients, rotation, affine transforms
Image Image(ImageCfg) Raster image
Svg Svg(SvgCfg) SVG vector image
Markdown w.Markdown(MarkdownCfg) Rendered Markdown
RTF RTF(RtfCfg) Rendered RTF
Badge Badge(BadgeCfg) Notification count badge
DrawCanvas DrawCanvas(DrawCanvasCfg) Custom-draw surface (shapes, text, images)

Display widgets in depth


Data

Structured data views.

Widget Factory Description
Table Table(TableCfg) Static, sortable data table
DataGrid w.DataGrid(DataGridCfg) Virtualized grid with sorting, filtering, inline editing, export
Tree Tree(TreeCfg) Hierarchical tree view with lazy-load support
DatePicker DatePicker(DatePickerCfg) Calendar date picker; single or multi-select
DatePickerRoller DatePickerRoller(DatePickerRollerCfg) Drum-style date roller

Data widgets in depth


Navigation

Structural navigation controls.

Widget Factory Description
TabControl TabControl(TabControlCfg) Tabbed panel switching; reorderable tabs
Breadcrumb Breadcrumb(BreadcrumbCfg) Navigational breadcrumb trail
Menubar Menubar(w, MenubarCfg) Application menu bar
Menu Menu(MenuCfg) Pull-down menu
ContextMenu ContextMenu(w, ContextMenuCfg) Right-click context menu
Sidebar w.Sidebar(SidebarCfg) Animated slide-out panel
CommandPalette CommandPalette(CommandPaletteCfg) Fuzzy-search command palette

Navigation widgets in depth


Feedback

Status indicators, notifications, and overlays.

Widget Factory Description
ProgressBar ProgressBar(ProgressBarCfg) Determinate or indeterminate progress bar
Pulsar Pulsar(PulsarCfg) Animated icon pulse for loading states
Toast w.Toast(ToastCfg) Transient notification
Dialog w.Dialog(DialogCfg) Modal dialog
WithTooltip WithTooltip(w, WithTooltipCfg) Hover tooltip wrapper

Feedback widgets in depth


Layout containers

See Layouts for the full layout system documentation.

Container Factory Description
Row Row(ContainerCfg) Horizontal flex container
Column Column(ContainerCfg) Vertical flex container
Wrap Wrap(ContainerCfg) Flow-wrap container
Canvas Canvas(ContainerCfg) Absolute-position canvas
Circle Circle(ContainerCfg) Circular clipping container
Rectangle Rectangle(RectangleCfg) Styled rectangle
ExpandPanel ExpandPanel(ExpandPanelCfg) Collapsible accordion section
Splitter Split(SplitterCfg) Resizable two-pane split
DockLayout DockLayout(DockCfg) Drag-and-drop dock areas
OverflowPanel OverflowPanel(OverflowPanelCfg) Overflowing children with scroll
RotatedBox RotatedBox(RotatedBoxCfg) Quarter-turn rotation

Layouts in depth

Clone this wiki locally