ui

package
v1.0.31-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 70 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SemanticText         = elements.SemanticText
	SemanticButton       = elements.SemanticButton
	SemanticInput        = elements.SemanticInput
	SemanticCheckbox     = elements.SemanticCheckbox
	SemanticSlider       = elements.SemanticSlider
	SemanticSelect       = elements.SemanticSelect
	SemanticTab          = elements.SemanticTab
	SemanticMenuItem     = elements.SemanticMenuItem
	SemanticLink         = elements.SemanticLink
	SemanticImage        = elements.SemanticImage
	SemanticScroll       = elements.SemanticScroll
	SemanticCustom       = elements.SemanticCustom
	SemanticHeading      = elements.SemanticHeading
	SemanticSwitch       = elements.SemanticSwitch
	SemanticRadio        = elements.SemanticRadio
	SemanticProgress     = elements.SemanticProgress
	SemanticGroup        = elements.SemanticGroup
	SemanticList         = elements.SemanticList
	SemanticListItem     = elements.SemanticListItem
	SemanticTable        = elements.SemanticTable
	SemanticRow          = elements.SemanticRow
	SemanticCell         = elements.SemanticCell
	SemanticColumnHeader = elements.SemanticColumnHeader
	SemanticDialog       = elements.SemanticDialog
	SemanticAlert        = elements.SemanticAlert
	SemanticStatus       = elements.SemanticStatus
	SemanticMenu         = elements.SemanticMenu
	SemanticMenuBar      = elements.SemanticMenuBar
	SemanticTabList      = elements.SemanticTabList
	SemanticTabPanel     = elements.SemanticTabPanel
	SemanticTree         = elements.SemanticTree
	SemanticTreeItem     = elements.SemanticTreeItem
	SemanticComboBox     = elements.SemanticComboBox
	SemanticToolbar      = elements.SemanticToolbar
	SemanticRegion       = elements.SemanticRegion
)

Semantic roles, for SemanticNode.Kind; see accessibility.md.

View Source
const (
	NotCheckable  = elements.NotCheckable
	Unchecked     = elements.Unchecked
	Checked       = elements.Checked
	Mixed         = elements.Mixed
	NotExpandable = elements.NotExpandable
	Collapsed     = elements.Collapsed
	Expanded      = elements.Expanded
	LiveOff       = elements.LiveOff
	LivePolite    = elements.LivePolite
	LiveAssertive = elements.LiveAssertive
)

Accessibility states (SemanticNode.Checked, Expanded, Live).

View Source
const (
	// The platforms; combine them with |. PlatformLinux includes other
	// Unix desktops; PlatformDesktop is Windows, macOS and Linux,
	// PlatformMobile Android and iOS.
	PlatformWindows = platform.Windows
	PlatformMacOS   = platform.MacOS
	PlatformLinux   = platform.Linux
	PlatformAndroid = platform.Android
	PlatformIOS     = platform.IOS
	PlatformWeb     = platform.Web
	PlatformDesktop = platform.Desktop
	PlatformMobile  = platform.Mobile
	// CurrentPlatform is the platform the app was built for: a
	// constant.
	CurrentPlatform = platform.Current
)
View Source
const (
	// DragSourceDim fades a dragged Draggable in its place (the
	// default), DragSourceHide leaves its space empty, DragSourceKeep
	// draws it as it is.
	DragSourceDim  = dnd.SourceDim
	DragSourceHide = dnd.SourceHide
	DragSourceKeep = dnd.SourceKeep
	// DragAxisVertical and DragAxisHorizontal: a list's axis
	// (DropTarget.List), or the one a preview keeps to
	// (Draggable.LockAxis).
	DragAxisBoth       = dnd.AxisBoth
	DragAxisVertical   = dnd.AxisVertical
	DragAxisHorizontal = dnd.AxisHorizontal
)
View Source
const (
	VariantContained = button.VariantContained
	VariantOutlined  = button.VariantOutlined
	VariantGhost     = button.VariantGhost

	IconButtonContained = iconbutton.VariantContained
	IconButtonOutlined  = iconbutton.VariantOutlined
	IconButtonGhost     = iconbutton.VariantGhost
)
View Source
const (
	ChartLine          = chart.Line
	ChartArea          = chart.Area
	ChartBar           = chart.Bar
	ChartHorizontalBar = chart.HorizontalBar
	ChartScatter       = chart.Scatter
	ChartPie           = chart.Pie
	ChartDonut         = chart.Donut
	ChartFunnel        = chart.Funnel
	ChartGauge         = chart.Gauge
	ChartHeatmap       = chart.Heatmap
)

Chart kinds.

View Source
const (
	ChartLegendAuto   = chart.LegendAuto
	ChartLegendNone   = chart.LegendNone
	ChartLegendTop    = chart.LegendTop
	ChartLegendBottom = chart.LegendBottom
)

Chart legend positions.

View Source
const (
	RichSubmitNone     = richedit.SubmitNone
	RichSubmitEnter    = richedit.SubmitEnter
	RichSubmitShortcut = richedit.SubmitShortcut
)

What Enter does in a RichEditor.

View Source
const (
	CalendarMonth  = calendarview.Month
	CalendarWeek   = calendarview.Week
	CalendarDay    = calendarview.Day
	CalendarAgenda = calendarview.Agenda
)
View Source
const (
	SheetNever   = dropdown.SheetNever
	SheetCompact = dropdown.SheetCompact
	SheetAlways  = dropdown.SheetAlways
)
View Source
const (
	Vertical     = scroll.Vertical
	Horizontal   = scroll.Horizontal
	AnchorTop    = scroll.AnchorTop
	AnchorBottom = scroll.AnchorBottom
)
View Source
const (
	SubmitDefault          = input.SubmitDefault
	SubmitEnter            = input.SubmitEnter
	SubmitEnterUnlessShift = input.SubmitEnterUnlessShift
	SubmitNever            = input.SubmitNever
)
View Source
const (
	DetentFit    = sheet.DetentFit
	DetentMedium = sheet.DetentMedium
	DetentLarge  = sheet.DetentLarge
)
View Source
const (
	KeyboardText    = input.KeyboardText
	KeyboardNumeric = input.KeyboardNumeric
	KeyboardEmail   = input.KeyboardEmail
	KeyboardURL     = input.KeyboardURL
	KeyboardPhone   = input.KeyboardPhone
)
View Source
const (
	SideLeft  = drawer.Left
	SideRight = drawer.Right
	// SideStart and SideEnd follow the reading direction: left and
	// right, swapped in a right-to-left locale.
	SideStart = drawer.Start
	SideEnd   = drawer.End
)
View Source
const (
	ModeLight = properties.ModeLight
	ModeDark  = properties.ModeDark
)
View Source
const (
	TitleBarWindows = titlebar.VariantWindows
	TitleBarMac     = titlebar.VariantMac

	TitleBarMinimize = titlebar.ButtonMinimize
	TitleBarMaximize = titlebar.ButtonMaximize
	TitleBarClose    = titlebar.ButtonClose

	// Where the title goes; see TitleBar.TitlePlacement.
	TitleBarTitleAuto   = titlebar.TitleAuto
	TitleBarTitleStart  = titlebar.TitleStart
	TitleBarTitleCenter = titlebar.TitleCenter
)
View Source
const (
	ToastInfo    = toaster.Info
	ToastSuccess = toaster.Success
	ToastWarning = toaster.Warning
	ToastError   = toaster.Error

	ToastBottomRight  = toaster.BottomRight
	ToastBottomLeft   = toaster.BottomLeft
	ToastBottomCenter = toaster.BottomCenter
	ToastTopRight     = toaster.TopRight
	ToastTopLeft      = toaster.TopLeft
	ToastTopCenter    = toaster.TopCenter
	// ToastBottomEnd (the default), ToastBottomStart, ToastTopEnd and
	// ToastTopStart follow the reading direction.
	ToastBottomEnd   = toaster.BottomEnd
	ToastBottomStart = toaster.BottomStart
	ToastTopEnd      = toaster.TopEnd
	ToastTopStart    = toaster.TopStart
)
View Source
const (
	// PlaceAuto puts it below the trigger, or above when it doesn't fit.
	PlaceAuto  = elements.PlaceAuto
	PlaceBelow = elements.PlaceBelow
	PlaceAbove = elements.PlaceAbove
)
View Source
const (
	ScrollAlignNearest = virtuallist.AlignNearest
	ScrollAlignStart   = virtuallist.AlignStart
	ScrollAlignCenter  = virtuallist.AlignCenter
	ScrollAlignEnd     = virtuallist.AlignEnd
)
View Source
const (
	LazyAnchorTop    = lazylist.AnchorTop
	LazyAnchorBottom = lazylist.AnchorBottom
	LazyAlignStart   = lazylist.AlignStart
	LazyAlignCenter  = lazylist.AlignCenter
	LazyAlignEnd     = lazylist.AlignEnd
)
View Source
const (
	Fade          = transition.Fade
	SlideUp       = transition.SlideUp
	SlideDown     = transition.SlideDown
	SlideLeft     = transition.SlideLeft
	SlideRight    = transition.SlideRight
	Enlarge       = transition.Enlarge
	Shrink        = transition.Shrink
	Rotate        = transition.Rotate
	Collapse      = transition.Collapse
	CollapseWidth = transition.CollapseWidth
	FadeUp        = transition.FadeUp
	Zoom          = transition.Zoom
	Pop           = transition.Pop

	TransitionFast   = transition.Fast
	TransitionNormal = transition.Normal
	TransitionSlow   = transition.Slow
)
View Source
const (
	FlexDirectionRow    = properties.FlexDirectionRow
	FlexDirectionColumn = properties.FlexDirectionColumn

	WrapNoWrap = properties.WrapNoWrap
	WrapWrap   = properties.WrapWrap

	AlignStart   = properties.AlignStart
	AlignCenter  = properties.AlignCenter
	AlignEnd     = properties.AlignEnd
	AlignStretch = properties.AlignStretch
	// AlignBaseline lines a row's children up on their baselines.
	AlignBaseline = properties.AlignBaseline

	JustifyStart        = properties.JustifyStart
	JustifyCenter       = properties.JustifyCenter
	JustifyEnd          = properties.JustifyEnd
	JustifySpaceBetween = properties.JustifySpaceBetween
	JustifySpaceAround  = properties.JustifySpaceAround
	JustifySpaceEvenly  = properties.JustifySpaceEvenly

	TextAlignStart  = properties.TextAlignStart
	TextAlignCenter = properties.TextAlignCenter
	TextAlignEnd    = properties.TextAlignEnd

	FontWeightThin       = properties.FontWeightThin
	FontWeightExtraLight = properties.FontWeightExtraLight
	FontWeightLight      = properties.FontWeightLight
	FontWeightNormal     = properties.FontWeightNormal
	FontWeightMedium     = properties.FontWeightMedium
	FontWeightSemiBold   = properties.FontWeightSemiBold
	FontWeightBold       = properties.FontWeightBold
	FontWeightExtraBold  = properties.FontWeightExtraBold
	FontWeightBlack      = properties.FontWeightBlack

	FontStyleNormal = properties.FontStyleNormal
	FontStyleItalic = properties.FontStyleItalic

	CursorDefault    = properties.CursorDefault
	CursorNone       = properties.CursorNone
	CursorText       = properties.CursorText
	CursorPointer    = properties.CursorPointer
	CursorCrosshair  = properties.CursorCrosshair
	CursorGrab       = properties.CursorGrab
	CursorGrabbing   = properties.CursorGrabbing
	CursorNotAllowed = properties.CursorNotAllowed
	CursorWait       = properties.CursorWait
	CursorProgress   = properties.CursorProgress
	CursorMove       = properties.CursorMove
	CursorVertical   = properties.CursorVertical
	CursorColResize  = properties.CursorColResize
	CursorRowResize  = properties.CursorRowResize
	CursorEWResize   = properties.CursorEWResize
	CursorNSResize   = properties.CursorNSResize
	CursorNESWResize = properties.CursorNESWResize
	CursorNWSEResize = properties.CursorNWSEResize
	CursorNResize    = properties.CursorNResize
	CursorSResize    = properties.CursorSResize
	CursorEResize    = properties.CursorEResize
	CursorWResize    = properties.CursorWResize
	CursorNEResize   = properties.CursorNEResize
	CursorNWResize   = properties.CursorNWResize
	CursorSEResize   = properties.CursorSEResize
	CursorSWResize   = properties.CursorSWResize

	FitNone    = properties.FitNone
	FitContain = properties.FitContain
	FitCover   = properties.FitCover
	FitStretch = properties.FitStretch

	PositionStatic   = properties.PositionStatic
	PositionRelative = properties.PositionRelative
	PositionAbsolute = properties.PositionAbsolute
	// PositionSticky, PositionStickyStart and PositionStickyTopStart hold
	// a box at a Scroll's top, start or both edges when scrolled past.
	PositionSticky         = properties.PositionSticky
	PositionStickyStart    = properties.PositionStickyStart
	PositionStickyTopStart = properties.PositionStickyTopStart
	// Flush is an explicit zero offset for Top, Right, Bottom and Left,
	// whose zero value means unset: Bottom: giode.Flush pins a box to
	// the bottom edge.
	Flush = properties.Flush

	TextDecorationNone        = properties.TextDecorationNone
	TextDecorationUnderline   = properties.TextDecorationUnderline
	TextDecorationLineThrough = properties.TextDecorationLineThrough

	OverflowVisible = properties.OverflowVisible
	OverflowHidden  = properties.OverflowHidden

	DisplayNone       = properties.DisplayNone
	DisplayGrid       = properties.DisplayGrid
	VisibilityVisible = properties.VisibilityVisible
	VisibilityHidden  = properties.VisibilityHidden

	TextTransformNone       = properties.TextTransformNone
	TextTransformUppercase  = properties.TextTransformUppercase
	TextTransformLowercase  = properties.TextTransformLowercase
	TextTransformCapitalize = properties.TextTransformCapitalize

	TextOverflowClip     = properties.TextOverflowClip
	TextOverflowEllipsis = properties.TextOverflowEllipsis

	MousePrimary   = elements.MousePrimary
	MouseSecondary = elements.MouseSecondary
	MouseMiddle    = elements.MouseMiddle

	ClickPointer      = elements.ClickPointer
	ClickKeyboard     = elements.ClickKeyboard
	ClickProgrammatic = elements.ClickProgrammatic

	EaseInOut     = properties.EaseInOut
	Ease          = properties.Ease
	EaseLinear    = properties.EaseLinear
	EaseIn        = properties.EaseIn
	EaseOut       = properties.EaseOut
	EaseOutBack   = properties.EaseOutBack
	EaseInBack    = properties.EaseInBack
	EaseOutBounce = properties.EaseOutBounce
)
View Source
const (
	TextAnchorTopLeft     = elements.TextAnchorTopLeft
	TextAnchorTop         = elements.TextAnchorTop
	TextAnchorTopRight    = elements.TextAnchorTopRight
	TextAnchorLeft        = elements.TextAnchorLeft
	TextAnchorCenter      = elements.TextAnchorCenter
	TextAnchorRight       = elements.TextAnchorRight
	TextAnchorBottomLeft  = elements.TextAnchorBottomLeft
	TextAnchorBottom      = elements.TextAnchorBottom
	TextAnchorBottomRight = elements.TextAnchorBottomRight
)

The points of a text Painter.Text can put at (x, y).

View Source
const (
	AutofillNone        = input.AutofillNone
	AutofillUsername    = input.AutofillUsername
	AutofillPassword    = input.AutofillPassword
	AutofillNewPassword = input.AutofillNewPassword
	AutofillEmail       = input.AutofillEmail
	AutofillOneTimeCode = input.AutofillOneTimeCode
	AutofillName        = input.AutofillName
	AutofillPhone       = input.AutofillPhone
	AutofillAddress     = input.AutofillAddress
	AutofillPostalCode  = input.AutofillPostalCode
)

What a text field holds; see Input.Autofill.

View Source
const (
	KeyPress   = key.Press
	KeyRelease = key.Release

	KeyModCtrl    = key.ModCtrl
	KeyModShift   = key.ModShift
	KeyModAlt     = key.ModAlt
	KeyModSuper   = key.ModSuper
	KeyModCommand = key.ModCommand

	KeyLeft      = key.NameLeftArrow
	KeyRight     = key.NameRightArrow
	KeyUp        = key.NameUpArrow
	KeyDown      = key.NameDownArrow
	KeyReturn    = key.NameReturn
	KeyEnter     = key.NameEnter
	KeyEscape    = key.NameEscape
	KeyHome      = key.NameHome
	KeyEnd       = key.NameEnd
	KeyBackspace = key.NameDeleteBackward
	KeyDelete    = key.NameDeleteForward
	KeyPageUp    = key.NamePageUp
	KeyPageDown  = key.NamePageDown
	KeyTab       = key.NameTab
	KeySpace     = key.NameSpace
	KeyCtrl      = key.NameCtrl
	KeyShift     = key.NameShift
	KeyAlt       = key.NameAlt
	KeySuper     = key.NameSuper
	KeyCommand   = key.NameCommand
	KeyBack      = key.NameBack
	KeyF1        = key.NameF1
	KeyF2        = key.NameF2
	KeyF3        = key.NameF3
	KeyF4        = key.NameF4
	KeyF5        = key.NameF5
	KeyF6        = key.NameF6
	KeyF7        = key.NameF7
	KeyF8        = key.NameF8
	KeyF9        = key.NameF9
	KeyF10       = key.NameF10
	KeyF11       = key.NameF11
	KeyF12       = key.NameF12
)

Key states, modifiers and the names of keys that aren't characters.

View Source
const (
	SplitHorizontal = splitpane.Horizontal
	SplitVertical   = splitpane.Vertical
)
View Source
const OverlayMargin = kit.Margin

OverlayMargin is the default distance kept between an overlay and the window edges.

Variables

View Source
var (
	// Accessible lays an element out and adjusts the nodes it reports
	// to screen readers (a text as a heading); AccessibleGroup makes it
	// a container (a region, a list, a toolbar).
	Accessible      = elements.Accessible
	AccessibleGroup = elements.AccessibleGroup
	// RecordSemantic reports a custom component's node;
	// BeginSemanticGroup starts a container around its content.
	RecordSemantic     = elements.RecordSemantic
	BeginSemanticGroup = elements.BeginSemanticGroup
)
View Source
var (
	// ForgetKeyed drops a Keyed entry right away.
	ForgetKeyed = elements.ForgetKeyed
	// SetKeyedRetention sets how many frames Keyed entries survive
	// without being asked for.
	SetKeyedRetention = elements.SetKeyedRetention
)
View Source
var (
	Box = elements.Box
	// Keyframes returns a keyframe animation through frames, for
	// BoxElement.Animation.
	Keyframes = elements.Keyframes
	Row       = elements.Row
	Stack     = elements.Stack
	// Grid lays children out on a grid; see elements.Grid.
	Grid = elements.Grid
	// GridSpan places a grid's child across n tracks, wherever there's
	// room; GridCell from a 1-based track across span tracks. They go
	// in its GridColumn and GridRow.
	GridSpan = properties.Span
	GridCell = properties.Cell
	Text     = elements.Text
	Raw      = elements.Raw
	// Intl returns the translation of key in the app's locale with data
	// filled into its {placeholders}: a map, a struct or name, value
	// pairs; a "count" picks plural forms. Turn translations on with
	// Config.Intl. See i18n.Intl.
	Intl = i18n.Intl
	// SetLocale switches the app's locale ("fa", "pt-BR"); the UI
	// redraws in it.
	SetLocale = i18n.SetLocale
	// Locale returns the app's locale.
	Locale = i18n.Locale
	// Locales lists the locales with messages loaded.
	Locales = i18n.Locales
	// Canvas is an element drawn with a Painter: shapes, arcs, rings,
	// sectors and paths in dp; see elements.Canvas.
	Canvas = elements.Canvas

	Divider = elements.Divider
	// RichText lays out differently styled spans as one wrapping
	// paragraph; see elements.RichText.
	RichText = elements.RichText
	// Span is a run of text in a RichText; Link a tappable one.
	Span = elements.SpanText
	Link = elements.Link
	// SpanElement sets an element, such as an inline formula, in a
	// RichText's line; see elements.SpanElement.
	SpanElement = elements.SpanElement
	// Markdown renders Markdown as giode elements; see markdown.New.
	Markdown = markdown.New
	// MarkdownFetchImage loads images for MarkdownOptions.LoadImage:
	// URLs, data: URIs and files; see markdown.FetchImage.
	MarkdownFetchImage = markdown.FetchImage
	Responsive         = elements.Responsive
	// ActiveBreakpoint returns the name of the breakpoint the innermost
	// enclosing Responsive matched.
	ActiveBreakpoint = elements.ActiveBreakpoint
	// Compact reports whether the innermost enclosing Responsive matched
	// a breakpoint named "compact".
	Compact = elements.Compact
	// HandleBack registers a handler for the system Back button for the
	// current frame; see elements.HandleBack.
	HandleBack = elements.HandleBack
	// OnKey registers, for this frame, a handler for the keys nothing
	// else took (app shortcuts); see elements.OnKey.
	OnKey = elements.OnKey
	// NoInset is an explicit zero Padding or Margin: an all-zero Inset
	// means unset (Merge keeps the base's, components use their default).
	NoInset = properties.NoInset
	// Shortcut returns a keyboard shortcut ("Mod+T", "Ctrl+Shift+P",
	// "F5") running action; Mod is Command on macOS, Ctrl elsewhere.
	// Register shortcuts with Shortcuts. See package shortcut.
	Shortcut = shortcut.New
	// FormatShortcut writes a shortcut spec the way this platform
	// shows it: "⇧⌘T" on macOS, "Ctrl+Shift+T" elsewhere.
	FormatShortcut = shortcut.Format
	// TouchInput reports whether the user is interacting by touch.
	TouchInput = elements.TouchInput

	// Pressable makes any content clickable; its content is rebuilt
	// with the current PressState so it can restyle itself.
	Pressable = elements.NewPressable

	// Memo caches the output of build under key, rebuilding only when
	// its deps, the States it reads, its constraints or the theme
	// change - see elements.MemoCache for the full rules.
	Memo = elements.Memo
	// SelectionArea makes the Text, RichText and Markdown inside its
	// child selectable as one, across elements, like a web page.
	SelectionArea = elements.SelectionArea

	// NewMemoCache returns a cache to hold in a stateful component.
	NewMemoCache = elements.NewMemoCache
	// InvalidateCaches forces every Memo to rebuild on the next frame.
	InvalidateCaches = elements.InvalidateCaches

	// AfterLayout runs a function once the current frame's layout is
	// done, on the UI goroutine - for handlers that change the model
	// the frame is still reading.
	AfterLayout = elements.AfterLayout
	// DisplayScale returns the display's pixels per dp as of the last
	// frame; DpToPx and PxToDp convert with it. Safe from anywhere.
	DisplayScale = elements.DisplayScale
	DpToPx       = elements.DpToPx
	PxToDp       = elements.PxToDp

	Table       = elements.Table
	TableHeader = elements.TableHeader
	TableRow    = elements.TableRow
	TableCell   = elements.TableCell
)
View Source
var (
	Button = button.New
	// CopyButton copies text to the clipboard when clicked and briefly
	// shows a check mark.
	CopyButton = copybutton.New
	IconButton = iconbutton.New
	Tabs       = tabs.New
	// DocTabs is a strip of document tabs the app adds, removes and
	// renames, with close buttons and unsaved dots; see doctabs.New.
	DocTabs = doctabs.New
	// DataGrid is a virtualized table for large data sets; see
	// datagrid.New.
	DataGrid = datagrid.New
	// NewLandmark returns a named region of the window - the main
	// content, the navigation - that skip links jump to and screen
	// readers move between; see skiplink.Landmark.
	NewLandmark = skiplink.NewLandmark
	// SkipLink is a link that shows only while keyboard-focused and
	// moves the focus into a Landmark; see skiplink.SkipLink.
	SkipLink = skiplink.New
	// OnlyOn shows what its builder makes on some platforms only, and
	// nothing elsewhere; see platform.OnlyOn.
	OnlyOn = platform.OnlyOn
	// ByPlatform shows the current platform's element of a
	// PlatformViews; see platform.ByPlatform.
	ByPlatform = platform.ByPlatform
	// IsPlatform reports whether the app runs on one of a set of
	// platforms.
	IsPlatform = platform.Is
	// Draggable is content that can be dragged to a DropTarget,
	// carrying a payload; see dnd.NewDraggable.
	Draggable = dnd.NewDraggable
	// DropTarget is an area drags can be dropped on; see
	// dnd.NewDropTarget.
	DropTarget = dnd.NewDropTarget
	// DropListItem makes an element item index of the innermost list
	// DropTarget, for its insertion slots; see dnd.ListItem.
	DropListItem = dnd.ListItem
	// Dragging reports whether a drag is in progress; CancelDrag ends
	// it.
	Dragging   = dnd.Dragging
	CancelDrag = dnd.Cancel
	// CanDragOut reports whether drags can leave the window on this
	// platform (Draggable.Export).
	CanDragOut = dnd.CanExport
	Scroll     = scroll.New
	// Swipeable makes a row reveal actions when swiped sideways; see
	// swipeable.New.
	Swipeable = swipeable.New
	// Zoomable pinch-zooms and pans its content - a page, a photo, a
	// crop editor - with a double tap and Ctrl+wheel too; see zoom.New.
	Zoomable = zoom.New
	// Sheet is a modal bottom sheet, or with Adaptive a centered
	// dialog on wide screens; see sheet.New.
	Sheet = sheet.New
	// Chip is a small rounded label for filters and tags; Badge a
	// counter or dot; Avatar a picture or initials in a circle.
	Chip   = chip.New
	Badge  = badge.New
	Avatar = avatar.New
	Drawer = drawer.New
	Dialog = dialog.New
	Menu   = menu.New
	// MenuBar groups menus into a menu bar (File, Edit, View): once one
	// is open, moving onto another's trigger switches to it; see
	// menu.Bar.
	MenuBar = menu.NewBar

	Progress   = progress.Progress
	Spinner    = spinner.Spinner
	Image      = imageutil.New
	Tooltip    = tooltip.New
	Accordion  = accordion.New
	Pagination = pagination.New

	H1 = title.H1
	H2 = title.H2
	H3 = title.H3
	H4 = title.H4
	H5 = title.H5
	H6 = title.H6
)
View Source
var (
	// IconSVG renders raw SVG path data on a 24x24 viewBox.
	IconSVG = icon.SVG
	// IconSVGEvenOdd is IconSVG with fill-rule="evenodd": inner
	// subpaths cut holes whichever way they run.
	IconSVGEvenOdd = icon.SVGEvenOdd
	// IconSVGCustom renders raw SVG path data on a custom viewBox.
	IconSVGCustom = icon.SVGCustom
	// IconSVGStroke strokes raw SVG path data (outline icon sets).
	IconSVGStroke = icon.SVGStroke
	IconImage     = icon.Image
	IconIconVG    = icon.IconVG
	LoadIconVG    = icon.LoadIconVG

	// LoadIconSVG parses a whole .svg file's bytes; call .Icon(st...)
	// on the result to render it.
	LoadIconSVG = icon.LoadSVG
	// MustLoadIconSVG is LoadIconSVG, panicking on error - convenient
	// for bytes known at compile time, e.g. via go:embed.
	MustLoadIconSVG = icon.MustLoadSVG
	// LoadIconSVGFile and LoadIconSVGFS read and parse an .svg file
	// from disk or from an fs.FS (such as an embed.FS).
	LoadIconSVGFile = icon.LoadSVGFile
	LoadIconSVGFS   = icon.LoadSVGFS

	// RegisterIcon, RegisterIconSVG, RegisterIconsFS and
	// RegisterIconsDir add icons to the default registry; Icon renders
	// one by name.
	RegisterIcon     = icon.Register
	RegisterIconSVG  = icon.RegisterSVG
	RegisterIconsFS  = icon.RegisterFS
	RegisterIconsDir = icon.RegisterDir
	LookupIcon       = icon.Lookup
	IconNames        = icon.Names
	// Icon renders a registered icon; an unknown name renders as empty
	// space of the icon's size.
	Icon = icon.Named
)

Giode bundles no icon set: load the icons your app uses from SVG files (or path data, IconVG, images) and, optionally, register them by name.

View Source
var (
	UseGofont     = fonts.UseGofont
	RegisterFonts = fonts.Register
	// RegisterFont adds TTF, OTF or TTC font files by family, weight
	// and style; see fonts.RegisterFont.
	RegisterFont = fonts.RegisterFont
	// SetDefaultFont makes a registered family the font of all text
	// without a FontFamily, Giode's components included; see
	// fonts.SetDefaultFont and Config.Font.
	SetDefaultFont = fonts.SetDefaultFont
)
View Source
var (
	HexColor = properties.HexColor
	// Mix blends two colors in sRGB space, like CSS; see properties.Mix.
	Mix = properties.Mix
	// ParseColor validates any CSS color (hex, rgb(), hsl(), named).
	ParseColor = properties.ParseColor
	// Linear builds a linear gradient for Styles.BackgroundGradient.
	Linear = properties.Linear

	UniformCorners = properties.UniformCorners
	TopCorners     = properties.TopCorners
	BottomCorners  = properties.BottomCorners

	UniformInset   = properties.UniformInset
	SymmetricInset = properties.SymmetricInset
)
View Source
var (
	// SetMode switches the active color mode, changing what every
	// "theme.*" color token (e.g. Styles{Background: "theme.surface"})
	// resolves to on the next frame.
	SetMode = properties.SetMode
	// CurrentMode returns the active color mode (ModeLight by
	// default).
	CurrentMode = properties.CurrentMode
	// SetPalette replaces the palette used for mode m, changing what
	// every "theme.*" color token resolves to while that mode is
	// active. Start from DefaultLightPalette/DefaultDarkPalette to
	// override just a few fields.
	SetPalette = properties.SetPalette
	// SetThemeColor names an app color for one mode: "theme.<name>"
	// resolves to it while that mode is active (see Palette.Custom).
	SetThemeColor = properties.SetThemeColor
	// ToggleMode switches between light and dark mode.
	ToggleMode = properties.ToggleMode
	// CurrentPalette returns the palette of the active mode.
	CurrentPalette = properties.CurrentPalette
)
View Source
var (
	DefaultLightPalette = properties.DefaultLightPalette
	DefaultDarkPalette  = properties.DefaultDarkPalette
)

DefaultLightPalette and DefaultDarkPalette are the built-in palettes for ModeLight/ModeDark, in effect until SetPalette overrides one of them.

View Source
var (
	// AppShell returns a full-window layout: Header/Navbar/Aside/Footer
	// (each optional, via AppShellConfig) are fixed to their respective
	// edges, and Main fills the remaining space, offset by whichever of
	// them are present.
	AppShell = appshell.New
	// Header, Navbar, Aside and Footer build an AppShellConfig field -
	// AppShellConfig{Header: giode.Header(60, ...), ...}.
	Header = appshell.Header
	Navbar = appshell.Navbar
	Aside  = appshell.Aside
	Footer = appshell.Footer
	// Main wraps an AppShell's main content area.
	Main = appshell.Main
	// Section groups content inside a Navbar/Aside as a scrollable
	// area.
	Section = appshell.Section
)
View Source
var (
	Scale    = kit.Scale
	Hovered  = kit.Hovered
	Pressed  = kit.Pressed
	Alpha    = kit.Alpha
	ClampPos = kit.ClampPos
)
View Source
var (
	// Combobox is a searchable field that picks one option, from a list
	// or an asynchronous source; see combobox.New.
	Combobox = combobox.New
	// MultiSelect picks several options as chips; with Creatable it's a
	// tag input. See combobox.NewMulti.
	MultiSelect = combobox.NewMulti
	// Mentions adds @-style suggestions at the caret of a text field;
	// see combobox.NewMentions.
	Mentions = combobox.NewMentions
	// CommandPalette is a Mod+K search over the app's commands; see
	// palette.New.
	CommandPalette = palette.New
	// EmojiPicker is a searchable emoji grid with skin tones and
	// recents; see emojipicker.New.
	EmojiPicker = emojipicker.New
	// FuzzyMatch scores a fuzzy match of query in s; see combobox.Match.
	FuzzyMatch = combobox.Match
)
View Source
var CalendarView = calendarview.New

CalendarView creates a calendar of events by month, week, day or agenda; see calendarview.CalendarView.

View Source
var Chart = chart.New

Chart creates a chart of a kind; see chart.Chart.

View Source
var ChartTimeX = chart.TimeX

ChartTimeX converts a time to a ChartPoint X on a time axis.

View Source
var DateCalendar = datepicker.NewCalendar

DateCalendar creates a month calendar to pick a day or a range from; see datepicker.DateCalendar.

View Source
var FormatNumber = chart.FormatNumber

FormatNumber writes a number compactly: 1.2k, 3.4M.

View Source
var Input = InputAPI{
	Text:         input.New,
	Checkbox:     checkbox.New,
	Slider:       slider.New,
	Select:       dropdown.New,
	AutoComplete: autocomplete.New,
	Switch:       toggle.New,
	Segmented:    segmented.New,
	Number:       numberinput.New,
	Color:        colorpicker.New,
	Date:         datepicker.New,
	DateRange:    datepicker.NewRange,
	Time:         datepicker.NewTime,
	DateTime:     datepicker.NewDateTime,
}

Input groups the form-control constructors that collect user input: Input.Text, Input.Checkbox, Input.Slider, Input.Select and Input.AutoComplete.

View Source
var KeyModShortcut = key.ModShortcut

KeyModShortcut is Command on Apple platforms and Ctrl elsewhere.

View Source
var LazyList = lazylist.New

LazyList is a vertical list of rows of any height, identified by keys, that only builds the rows in or near the viewport. It keeps its place when rows above change, and can stick to the end like a chat:

list := giode.LazyList(
	func() int { return len(msgs) },
	func(i int) any { return msgs[i].ID },
	func(i int) giode.Element { return messageRow(msgs[i]) },
).Anchor(giode.LazyAnchorBottom)
View Source
var LicensesView = licenses.New

LicensesView lists the open-source licenses of the app's modules, from the JSON giode licenses writes; a row per module expands to its text.

View Source
var NewRouter = router.New
View Source
var RichEditor = richedit.New

RichEditor creates a rich text editor; see richedit.RichEditor. Its document model is package richdoc.

View Source
var Sparkline = chart.Sparkline

Sparkline draws a small line of values without axes.

View Source
var TitleBar = titlebar.New

TitleBar returns a custom window title bar for a frameless window: a drag handle with the title, optional icon and menus, and minimize/maximize/close buttons. Pass the *App:

app := giode.New(giode.Config{Frameless: true, Resizable: true})
bar := giode.TitleBar(app, "My app")
View Source
var Toaster = toaster.New

Toaster shows small notifications in a corner of the window that disappear on their own. Lay it out once per frame anywhere; call Show from any goroutine.

View Source
var Transition = transition.New

Transition animates a component in and out. It takes the component, the effect (combine kinds with |), the duration and a CSS-style easing:

panel := giode.Transition(content, giode.FadeUp, giode.TransitionNormal, giode.EaseOut)
giode.Button("Toggle").OnClick(panel.Toggle)
View Source
var TreeView = treeview.New

TreeView is a virtualized, keyboard-navigable tree. It owns expansion and selection by key and draws indentation, arrows and selection; the row function draws only each node's content.

View Source
var VirtualList = virtuallist.New

VirtualList is a vertical list of equal-height rows (height in dp) that only builds the rows in or near the viewport:

list := giode.VirtualList(func() int { return len(rows) }, 32,
	func(i int) giode.Element { return rowView(rows[i]) })

Functions

func DragAccept

func DragAccept[T any]() func(payload any) bool

DragAccept returns a DropTarget.Accept predicate for payloads of type T.

func DragPayload

func DragPayload[T any](payload any) (T, bool)

DragPayload returns a drop's payload as a T.

func Frame

func Frame(gtx layout.Context, view Element) (needsAnotherFrame bool)

Frame lays out one frame of view into gtx the way App does, for a custom host (a GLFW window, an embedded view): it starts the frame, records the window size and metric, lays the view out, draws the portals (menus, tooltips, toasts), delivers the Back key and then the keys nothing took to OnKey handlers, runs the after-layout callbacks and ends the frame, sweeping keyed state and memos no longer used. gtx's constraints are the window's size.

It reports whether another frame is needed right away (a layout changed after the fact); the host should then redraw. Animations ask for frames through gtx as usual (op.InvalidateCmd, the router's wakeup time), and State changes and toasts shown from other goroutines through the function given to SetInvalidator.

The host fills the background, hands gtx.Ops to its GPU renderer and runs its input router, as in docs/low-level.md.

func InsertItem

func InsertItem[T any](s []T, i int, v T) []T

InsertItem inserts v at slot i and returns the slice; RemoveItem removes s[i].

func Keyed

func Keyed[T any](scope, key any, init func() T) T

Keyed returns the state stored under (scope, key), creating it with init the first time - persistent per-item state (a Pressable, a text field) for lists that change at runtime. Entries not asked for in a while are dropped, so removed items don't leak. Use stable keys (IDs), not indexes.

func MoveItem

func MoveItem[T any](s []T, from, to int) int

MoveItem moves s[from] to insertion slot to (a DropEvent's Index for a drop in its own list) and returns the index it lands at.

func RemoveItem

func RemoveItem[T any](s []T, i int) []T

RemoveItem: see InsertItem.

func SetInvalidator

func SetInvalidator(fn func())

SetInvalidator registers fn, which wakes the host's loop for a new frame. It's called from any goroutine: when a State changes, a toast is shown from a background goroutine, or anything else outside a frame needs a redraw. App sets its own; a custom host sets one that wakes its event loop (glfw.PostEmptyEvent, a channel).

func Shortcuts

func Shortcuts(list ...KeyShortcut)

Shortcuts registers app-wide keyboard shortcuts for this frame: call it from the view every frame. They fire whatever has focus, unless the focused field (or anything else in the UI) takes the key first; see OnKey.

giode.Shortcuts(
	giode.Shortcut("Mod+T", newTab),
	giode.Shortcut("Mod+,", openSettings),
	giode.Shortcut("F5", refresh),
)

func WatchKeys

func WatchKeys(fn func(e KeyEvent))

WatchKeys registers fn, for this frame, to see every key press and release the app gets before anything acts on it - the modifier keys too, for a double Shift; see elements.WatchKeys. Call it from the view every frame, as with OnKey.

Types

type AccordionElement

type AccordionElement = accordion.Accordion

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Align

type Align = properties.Align

Style value and element types, for declaring variables and helpers that take them.

type AppShellConfig

type AppShellConfig = appshell.Config

type AppShellSlot

type AppShellSlot = appshell.Slot

type AutoCompleteElement

type AutoCompleteElement = autocomplete.AutoComplete

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type AutofillKind

type AutofillKind = input.AutofillKind

AutofillKind is what a text field holds, for password managers and AutoFill: Input.Autofill.

type AvatarElement

type AvatarElement = avatar.Avatar

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type BackgroundFit

type BackgroundFit = properties.BackgroundFit

Style value and element types, for declaring variables and helpers that take them.

type BackgroundImage

type BackgroundImage = properties.BackgroundImage

Style value and element types, for declaring variables and helpers that take them.

type BadgeElement

type BadgeElement = badge.Badge

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type BoxElement

type BoxElement = elements.BoxElement

Style value and element types, for declaring variables and helpers that take them.

type BoxShadow

type BoxShadow = properties.BoxShadow

type Breakpoint

type Breakpoint = elements.Breakpoint

type ButtonElement

type ButtonElement = button.Button

type ButtonVariant

type ButtonVariant = button.Variant

type CalendarEvent

type CalendarEvent = calendarview.Event

CalendarEvent is an event a CalendarView shows.

type CalendarMode

type CalendarMode = calendarview.Mode

CalendarMode is what a CalendarView shows.

type CalendarViewElement

type CalendarViewElement = calendarview.CalendarView

CalendarViewElement is CalendarView's type.

type CanvasPath

type CanvasPath = elements.Path

Style value and element types, for declaring variables and helpers that take them.

type ChartAxis

type ChartAxis = chart.Axis

Chart types.

type ChartBand

type ChartBand = chart.Band

Chart types.

type ChartElement

type ChartElement = chart.Chart

Chart types.

type ChartKind

type ChartKind = chart.Kind

Chart types.

type ChartLegend

type ChartLegend = chart.LegendPos

Chart types.

type ChartPoint

type ChartPoint = chart.Point

Chart types.

type ChartSeries

type ChartSeries = chart.Series

Chart types.

type CheckState

type CheckState = elements.CheckState

CheckState, ExpandState and LiveMode are accessibility states of a SemanticNode; SemanticContainer is a container being laid out.

type CheckboxElement

type CheckboxElement = checkbox.Checkbox

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type ChipElement

type ChipElement = chip.Chip

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type ClickEvent

type ClickEvent = elements.ClickEvent

type ClickSource

type ClickSource = elements.ClickSource

type Color

type Color = properties.Color

Color is a CSS-like color: "#3b82f6", "rgb(59 130 246)", a name, or a "theme.*" token that follows the palette.

type ColorPickerElement

type ColorPickerElement = colorpicker.ColorPicker

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type ColorStop

type ColorStop = properties.ColorStop

type ComboOption

type ComboOption = combobox.Option

ComboOption is a Combobox, MultiSelect or Mentions option.

type ComboSource

type ComboSource = combobox.Source

ComboSource fetches options for a query, for options on a server.

type ComboboxElement

type ComboboxElement = combobox.Combobox

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type ComboboxList

type ComboboxList = combobox.List

ComboboxList is a combobox's list of options; Emoji one emoji of the picker's set; License a module's license for LicensesView; IconVGIcon a decoded IconVG icon; MenuItem a menu's row.

type CommandPaletteElement

type CommandPaletteElement = palette.Palette

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Constraints

type Constraints = layout.Constraints

Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:

func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }

type Context

type Context = layout.Context

Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:

func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }

type ContextMenu

type ContextMenu = elements.ContextMenu

ContextMenu is what an element's Context takes: a Menu, or a menu of your own.

type Contextual

type Contextual = elements.Contextual

Contextual gives a custom element Context; see extending.md.

type CopyButtonElement

type CopyButtonElement = copybutton.CopyButton

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Corners

type Corners = properties.Corners

type Cursor

type Cursor = properties.Cursor

Style value and element types, for declaring variables and helpers that take them.

type DataGridColumn

type DataGridColumn = datagrid.Column

DataGridColumn is one of a DataGrid's columns; DataGridElement the grid, DataGridSortKey a level of its sort.

type DataGridColumnLayout

type DataGridColumnLayout = datagrid.ColumnLayout

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridEditorKind

type DataGridEditorKind = datagrid.EditorKind

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridElement

type DataGridElement = datagrid.DataGrid

type DataGridExportFormat

type DataGridExportFormat = datagrid.ExportFormat

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridFilter

type DataGridFilter = datagrid.ColumnFilter

DataGridFilter is a filter on a DataGrid column (SetFilter, OnFilter).

type DataGridFilterer

type DataGridFilterer = datagrid.Filterer

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridKeyer

type DataGridKeyer = datagrid.Keyer

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridLayout

type DataGridLayout = datagrid.GridLayout

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridLoader

type DataGridLoader = datagrid.Loader

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridSliceSource

type DataGridSliceSource[T any] = datagrid.SliceSource[T]

DataGridSliceSource is a data grid source over a slice of rows.

type DataGridSortKey

type DataGridSortKey = datagrid.SortKey

type DataGridSorter

type DataGridSorter = datagrid.Sorter

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DataGridSource

type DataGridSource = datagrid.Source

The data grid's data source and layout types.

type DateCalendarElement

type DateCalendarElement = datepicker.DateCalendar

DatePickerElement and the others are the date and time fields' types.

type DatePickerElement

type DatePickerElement = datepicker.DatePicker

DatePickerElement and the others are the date and time fields' types.

type DateRangePickerElement

type DateRangePickerElement = datepicker.DateRangePicker

DatePickerElement and the others are the date and time fields' types.

type DateTimeFieldElement

type DateTimeFieldElement = datepicker.DateTimeField

DatePickerElement and the others are the date and time fields' types.

type Detent

type Detent = sheet.Detent

Detent is a height a Sheet rests at.

type DialogElement

type DialogElement = dialog.Dialog

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Dimensions

type Dimensions = layout.Dimensions

Context is what an element's Layout gets: the constraints it must fit, the display metric, the ops to draw into and the input source (Gio's layout.Context). Dimensions is what Layout returns: the size it took and its baseline. With these, a custom element needs nothing from Gio:

func (r *Rating) Layout(gtx giode.Context) giode.Dimensions { ... }

type Display

type Display = properties.Display

type DividerElement

type DividerElement = elements.DividerElement

Style value and element types, for declaring variables and helpers that take them.

type DocTab

type DocTab = doctabs.Tab

DocTab is one document's tab in DocTabs; DocTabsElement the strip.

type DocTabsElement

type DocTabsElement = doctabs.DocTabs

type DragAxis

type DragAxis = dnd.Axis

type DragEvent

type DragEvent = elements.DragEvent

type DragExportData

type DragExportData = dnd.ExportData

DragExportData is what a Draggable gives other applications when it's dragged out of the window (Export): files, text.

type DragResult

type DragResult = dnd.DragResult

type DragSourceStyle

type DragSourceStyle = dnd.SourceStyle

DragSourceStyle is how a dragged Draggable shows in its place; DragAxis limits its preview's movement.

type DragState

type DragState = dnd.DragState

DragState is a Draggable's state for its content, DropState a DropTarget's; DropEvent is a drop, DragResult how a drag ended.

type DraggableElement

type DraggableElement = dnd.Draggable

DraggableElement is content that can be dragged (Draggable); DropTargetElement an area drags can be dropped on (DropTarget). See the dnd package.

type DrawerElement

type DrawerElement = drawer.Drawer

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type DropEvent

type DropEvent = dnd.DropEvent

type DropState

type DropState = dnd.DropState

type DropTargetElement

type DropTargetElement = dnd.DropTarget

type DroppedFiles

type DroppedFiles = dnd.Files

DroppedFiles is the payload of files dragged in from other applications, for drop targets (Config.FileDropTargets).

type Easing

type Easing = properties.Easing

type Element

type Element = elements.Element

func NoWindowDrag

func NoWindowDrag(el Element) Element

NoWindowDrag keeps el, inside a WindowDragArea, from dragging the window, so a press on it reaches it.

func WindowDragArea

func WindowDragArea(content Element) Element

WindowDragArea makes content a handle that drags its window, like an OS title bar: for a frameless window or portal drawing its own chrome. On Windows it also maximizes on a double-click and snaps to screen edges. Wrap buttons inside it in NoWindowDrag so they stay clickable. TitleBar does both for you.

type Emoji

type Emoji = emojipicker.Emoji

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type EmojiPickerElement

type EmojiPickerElement = emojipicker.Picker

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type ExpandState

type ExpandState = elements.ExpandState

type Fit

type Fit = properties.Fit

Style value and element types, for declaring variables and helpers that take them.

type FlexDirection

type FlexDirection = properties.FlexDirection

Style value and element types, for declaring variables and helpers that take them.

type FontFile

type FontFile = fonts.File

FontFile is a font file for RegisterFont.

type FontStyle

type FontStyle = properties.FontStyle

Style value and element types, for declaring variables and helpers that take them.

type FontWeight

type FontWeight = properties.FontWeight

Style value and element types, for declaring variables and helpers that take them.

type IconButtonElement

type IconButtonElement = iconbutton.Button

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type IconButtonVariant

type IconButtonVariant = iconbutton.Variant

type IconDocument

type IconDocument = icon.Document

type IconPath

type IconPath = icon.Path

type IconRegistry

type IconRegistry = icon.Registry

type IconSource

type IconSource = icon.Source

type IconVGIcon

type IconVGIcon = icon.IconVGIcon

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type ImageElement

type ImageElement = imageutil.ImageElement

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type InputAPI

type InputAPI struct {
	// Text creates a single-line text field.
	Text func(placeholder string, st ...Styles) *input.Input
	// Checkbox creates a checkbox. label is optional: pass "" for a
	// bare checkbox with no label.
	Checkbox func(label string, st ...Styles) *checkbox.Checkbox
	// Slider creates a horizontal slider in the range [0, 1].
	Slider func(st ...Styles) *slider.Slider
	// Select creates a dropdown choosing among options.
	Select func(st Styles, options ...string) *dropdown.Select
	// AutoComplete creates a text field with a filtered suggestion
	// list.
	AutoComplete func(placeholder string, options []string, st ...Styles) *autocomplete.AutoComplete
	// Switch creates an on/off switch with an animated knob. label is
	// optional.
	Switch func(label string, st ...Styles) *toggle.Switch
	// Segmented creates a segmented control choosing among options.
	Segmented func(options ...string) *segmented.Control
	// Number creates a numeric field between − and + steppers; set its
	// Range, Step and Decimals.
	Number func(value float64, st ...Styles) *numberinput.NumberInput
	// Color creates a color picker - saturation and brightness square,
	// hue bar, optional alpha bar, hex field and preset swatches -
	// showing value ("#3366FF").
	Color func(value string, st ...Styles) *colorpicker.ColorPicker
	// Date creates a date field with a calendar popover; typed dates
	// follow the locale's order.
	Date func(st ...Styles) *datepicker.DatePicker
	// DateRange creates start and end date fields with a two-month
	// calendar.
	DateRange func(st ...Styles) *datepicker.DateRangePicker
	// Time creates a time field with a list of times.
	Time func(st ...Styles) *datepicker.TimePicker
	// DateTime creates a date field and a time field together.
	DateTime func() *datepicker.DateTimeField
}

InputAPI groups the constructors for components whose purpose is collecting a value from the user.

type InputElement

type InputElement = input.Input

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type Inset

type Inset = properties.Inset

type Justify

type Justify = properties.Justify

Style value and element types, for declaring variables and helpers that take them.

type KeyEvent

type KeyEvent = key.Event

KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.

type KeyModifiers

type KeyModifiers = key.Modifiers

KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.

type KeyName

type KeyName = key.Name

KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.

type KeyShortcut

type KeyShortcut = shortcut.Shortcut

KeyShortcut is a keyboard shortcut made with Shortcut.

type KeyState

type KeyState = key.State

KeyEvent is a key press or release; KeyName names its key, as "A", "5", "F5" or one of the Key* names; KeyModifiers are the modifiers held.

type Keyboard

type Keyboard = input.Keyboard

Keyboard selects the on-screen keyboard for Input.Text fields; see input.Input.Keyboard.

type KeyboardInputElement

type KeyboardInputElement = input.KeyboardInput

KeyboardInputElement is the element KeyboardInput returns.

func KeyboardInput

func KeyboardInput(content Element) *KeyboardInputElement

KeyboardInput takes the keyboard for content the app draws itself - a terminal, a game, a canvas: it gets focus, the text typed (layout, dead keys and input methods applied) at OnText, and the other keys at OnKey, with Enter, Space and Tab passed on rather than activating anything. Create it once and lay it out every frame; see input.KeyboardInput.

term := giode.KeyboardInput(screen).
	OnText(func(s string) { pty.Write([]byte(s)) }).
	OnKey(func(e giode.KeyEvent) bool { return sendKey(pty, e) }).
	Keyboard(giode.KeyboardText)

type KeyedCache

type KeyedCache[K comparable, V any] = elements.KeyedCache[K, V]

KeyedCache is a typed map of per-item state that drops entries not asked for in a while; hold one in a stateful component.

func NewKeyedCache

func NewKeyedCache[K comparable, V any]() *KeyedCache[K, V]

NewKeyedCache returns an empty KeyedCache.

type Keyframe

type Keyframe = elements.Keyframe

Style value and element types, for declaring variables and helpers that take them.

type KeyframeAnimation

type KeyframeAnimation = elements.KeyframeAnimation

KeyframeAnimation plays styles through keyframes on a Box (BoxElement.Animation); Keyframe is one of its steps.

type Landmark

type Landmark = skiplink.Landmark

Landmark is a named region skip links jump to; see NewLandmark.

type LazyAlign

type LazyAlign = lazylist.Align

type LazyAnchor

type LazyAnchor = lazylist.Anchor

type LazyListElement

type LazyListElement = lazylist.List

type License

type License = licenses.License

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type LicensesElement

type LicensesElement = licenses.View

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type LinearGradient

type LinearGradient = properties.LinearGradient

type LiveMode

type LiveMode = elements.LiveMode

type MarkdownOptions

type MarkdownOptions = markdown.Options

MarkdownOptions configures Markdown.

type MaxLines

type MaxLines = properties.MaxLines

Style value and element types, for declaring variables and helpers that take them.

type MemoCache

type MemoCache = elements.MemoCache

type MentionsElement

type MentionsElement = combobox.Mentions

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type MenuElement = menu.Menu

MenuElement is a Menu: a context menu, a menu bar's menu, or a DocTabs tab menu to add items to.

type MenuItem = menu.Item

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Mode

type Mode = properties.Mode

type MouseButton

type MouseButton = elements.MouseButton

type MultiSelectElement

type MultiSelectElement = combobox.MultiSelect

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type NamedKey

type NamedKey = elements.NamedKey

NamedKey is a key, with exactly the modifiers to hold, that an OnKey handler asks for by name: Tab and Shift+Tab reach only a handler that names them. See OnKey.

type NumberInputElement

type NumberInputElement = numberinput.NumberInput

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type OutOfFlow

type OutOfFlow = elements.OutOfFlow

Style value and element types, for declaring variables and helpers that take them.

type Overflow

type Overflow = properties.Overflow

Style value and element types, for declaring variables and helpers that take them.

type PaginationElement

type PaginationElement = pagination.Pagination

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Painter

type Painter = elements.Painter

Style value and element types, for declaring variables and helpers that take them.

type Palette

type Palette = properties.Palette

type PaletteCommand

type PaletteCommand = palette.Command

PaletteCommand is a CommandPalette command.

type Placement

type Placement = elements.Placement

Placement is the side of its trigger a tooltip (or any portal placed with elements.RegisterPortalAround) goes.

type Platform

type Platform = platform.Platform

Platform is a set of platforms, for OnlyOn and IsPlatform; PlatformViews an element per platform, for ByPlatform.

type PlatformViews

type PlatformViews = platform.Views

type Position

type Position = properties.Position

Style value and element types, for declaring variables and helpers that take them.

type PressState

type PressState = elements.PressState

MemoCache caches a subtree's painted output across frames; see Memo.

type PressableElement

type PressableElement = elements.Pressable

type ProgressElement

type ProgressElement = progress.ProgressElement

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type RawFunc

type RawFunc = elements.RawFunc

Style value and element types, for declaring variables and helpers that take them.

type RichEditorElement

type RichEditorElement = richedit.RichEditor

RichEditorElement is RichEditor's type.

type RichSubmitMode

type RichSubmitMode = richedit.SubmitMode

RichSubmitMode is what Enter does in a rich editor; RichSuggester supplies its suggestions.

type RichSuggester

type RichSuggester = richedit.Suggester

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type RichSuggestion

type RichSuggestion = richedit.Suggestion

RichSuggestion is an entry of a RichEditor suggestion list.

type RichTextElement

type RichTextElement = elements.RichTextElement

Style value and element types, for declaring variables and helpers that take them.

type RichTextSpan

type RichTextSpan = elements.Span

RichTextSpan is one run of a RichText paragraph, made with Span or Link.

type Route

type Route = router.Route

type Router

type Router = router.Router

type ScrollAlign

type ScrollAlign = virtuallist.Align

type ScrollAnchor

type ScrollAnchor = scroll.Anchor

ScrollAxis selects the directions a Scroll scrolls in, and ScrollAnchor where it keeps growing content; see scroll.Scroll.Axis and Anchor.

type ScrollAxis

type ScrollAxis = scroll.Axis

ScrollAxis selects the directions a Scroll scrolls in, and ScrollAnchor where it keeps growing content; see scroll.Scroll.Axis and Anchor.

type ScrollBar

type ScrollBar = properties.ScrollBar

type ScrollElement

type ScrollElement = scroll.Scroll

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type SegmentedElement

type SegmentedElement = segmented.Control

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type SelectElement

type SelectElement = dropdown.Select

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type SemanticContainer

type SemanticContainer = elements.SemanticContainer

type SemanticKind

type SemanticKind = elements.SemanticKind

type SemanticNode

type SemanticNode = elements.SemanticNode

type SheetElement

type SheetElement = sheet.Sheet

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type SheetMode

type SheetMode = dropdown.SheetMode

SheetMode selects when a Select opens as a bottom sheet; see dropdown.Select.Sheet.

type Side

type Side = drawer.Side

type SkipLinkElement

type SkipLinkElement = skiplink.SkipLink

SkipLinkElement is the link SkipLink returns.

type SliderElement

type SliderElement = slider.Slider

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type SpinnerElement

type SpinnerElement = spinner.SpinnerElement

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type SplitAxis

type SplitAxis = splitpane.Axis

SplitPaneElement is the element SplitPane returns; SplitAxis how its panes are placed.

type SplitPaneElement

type SplitPaneElement = splitpane.SplitPane

SplitPaneElement is the element SplitPane returns; SplitAxis how its panes are placed.

func SplitPane

func SplitPane(first, second func() Element) *SplitPaneElement

SplitPane is two panes with a divider between them the user drags: a sidebar and an editor, an editor and a terminal. Create it once and lay it out every frame; see package splitpane.

split := giode.SplitPane(sidebar, editor).FirstSize(240)

type State

type State[T any] = state.State[T]

State is a minimal global-state primitive: an observable value readable/writable from anywhere, including a goroutine outside the render loop (a network response, a timer), not just from within a Layout call. Create it with NewState.

func NamedState

func NamedState[T any](name string, initial T) *State[T]

NamedState returns a State registered under name, so tooling - the MCP server's state_list/state_set tools - can read and set it. T must be JSON-encodable for that.

func NewState

func NewState[T any](initial T) *State[T]

NewState returns a State holding initial.

type StyleTransition

type StyleTransition = properties.Transition

type Styles

type Styles = styles.Styles

type SubmitMode

type SubmitMode = input.SubmitMode

SubmitMode selects which keys submit an Input; see input.Input.SubmitOn.

type SwipeAction

type SwipeAction = swipeable.Action

SwipeAction is a button revealed behind a Swipeable row.

type SwipeableElement

type SwipeableElement = swipeable.Swipeable

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type SwitchElement

type SwitchElement = toggle.Switch

The handles the Input constructors and Scroll return, for struct fields and function parameters: InputElement is a text field (Input.Text), CheckboxElement, SelectElement, SliderElement, SwitchElement, SegmentedElement, AutoCompleteElement, NumberInputElement and ColorPickerElement the other Input fields, ScrollElement a Scroll.

type Tab

type Tab = tabs.Tab

type TabWidth

type TabWidth = properties.TabWidth

Style value and element types, for declaring variables and helpers that take them.

type TabsElement

type TabsElement = tabs.Tabs

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type TerminalElement

type TerminalElement = terminal.Terminal

TerminalElement is the element Terminal returns; TerminalPalette its colors.

func Terminal

func Terminal() *TerminalElement

Terminal is a terminal: it runs a shell or any program in a pseudo-terminal (Start) or shows one the app connects (Attach and Write, for an SSH session), drawing its screen and taking the keyboard for it. Create it once and lay it out every frame; see package terminal.

term := giode.Terminal().OnExit(func(code int, err error) { closeTab() })
if err := term.Start(nil); err != nil { ... } // the user's shell

type TerminalPalette

type TerminalPalette = terminal.Palette

TerminalElement is the element Terminal returns; TerminalPalette its colors.

type TextAlign

type TextAlign = properties.TextAlign

Style value and element types, for declaring variables and helpers that take them.

type TextAnchor

type TextAnchor = elements.TextAnchor

Style value and element types, for declaring variables and helpers that take them.

type TextDecoration

type TextDecoration = properties.TextDecoration

Style value and element types, for declaring variables and helpers that take them.

type TextElement

type TextElement = elements.TextElement

Style value and element types, for declaring variables and helpers that take them.

type TextOverflow

type TextOverflow = properties.TextOverflow

type TextTransform

type TextTransform = properties.TextTransform

type TimeOfDay

type TimeOfDay = datepicker.TimeOfDay

TimeOfDay is a time on a clock, what a time field holds.

type TimePickerElement

type TimePickerElement = datepicker.TimePicker

DatePickerElement and the others are the date and time fields' types.

type TitleBarButton

type TitleBarButton = titlebar.Button

type TitleBarElement

type TitleBarElement = titlebar.TitleBar

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type TitleBarPlacement

type TitleBarPlacement = titlebar.TitlePlacement

type TitleBarVariant

type TitleBarVariant = titlebar.Variant

type TitleBarWindow

type TitleBarWindow = titlebar.Window

type ToastKind

type ToastKind = toaster.Kind

type ToastPlacement

type ToastPlacement = toaster.Placement

type ToasterElement

type ToasterElement = toaster.Toaster

type TooltipElement

type TooltipElement = tooltip.Tooltip

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

type Transform

type Transform = properties.Transform

type TransitionElement

type TransitionElement = transition.Transition

type TransitionKind

type TransitionKind = transition.Kind

type TreeNode

type TreeNode = treeview.Node

type TreeRowState

type TreeRowState = treeview.RowState

type TreeViewElement

type TreeViewElement = treeview.Tree

type VirtualListElement

type VirtualListElement = virtuallist.List

type Visibility

type Visibility = properties.Visibility

type Watch

type Watch[T comparable] = elements.Watch[T]

Watch tracks the fields a component caching its own output draws from; see MemoCache.LayoutOwn.

type Wrap

type Wrap = properties.Wrap

Style value and element types, for declaring variables and helpers that take them.

type ZoomElement

type ZoomElement = zoom.Zoom

The types the component constructors return, for keeping a stateful component in a struct field or passing it around; the constructor itself has the plain name (Dialog creates a *DialogElement).

Jump to

Keyboard shortcuts

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