Documentation
¶
Index ¶
- Constants
- Variables
- func DragAccept[T any]() func(payload any) bool
- func DragPayload[T any](payload any) (T, bool)
- func Frame(gtx layout.Context, view Element) (needsAnotherFrame bool)
- func InsertItem[T any](s []T, i int, v T) []T
- func Keyed[T any](scope, key any, init func() T) T
- func MoveItem[T any](s []T, from, to int) int
- func RemoveItem[T any](s []T, i int) []T
- func SetInvalidator(fn func())
- func Shortcuts(list ...KeyShortcut)
- func WatchKeys(fn func(e KeyEvent))
- type AccordionElement
- type Align
- type AppShellConfig
- type AppShellSlot
- type AutoCompleteElement
- type AutofillKind
- type AvatarElement
- type BackgroundFit
- type BackgroundImage
- type BadgeElement
- type BoxElement
- type BoxShadow
- type Breakpoint
- type ButtonElement
- type ButtonVariant
- type CalendarEvent
- type CalendarMode
- type CalendarViewElement
- type CanvasPath
- type ChartAxis
- type ChartBand
- type ChartElement
- type ChartKind
- type ChartLegend
- type ChartPoint
- type ChartSeries
- type CheckState
- type CheckboxElement
- type ChipElement
- type ClickEvent
- type ClickSource
- type Color
- type ColorPickerElement
- type ColorStop
- type ComboOption
- type ComboSource
- type ComboboxElement
- type ComboboxList
- type CommandPaletteElement
- type Constraints
- type Context
- type ContextMenu
- type Contextual
- type CopyButtonElement
- type Corners
- type Cursor
- type DataGridColumn
- type DataGridColumnLayout
- type DataGridEditorKind
- type DataGridElement
- type DataGridExportFormat
- type DataGridFilter
- type DataGridFilterer
- type DataGridKeyer
- type DataGridLayout
- type DataGridLoader
- type DataGridSliceSource
- type DataGridSortKey
- type DataGridSorter
- type DataGridSource
- type DateCalendarElement
- type DatePickerElement
- type DateRangePickerElement
- type DateTimeFieldElement
- type Detent
- type DialogElement
- type Dimensions
- type Display
- type DividerElement
- type DocTab
- type DocTabsElement
- type DragAxis
- type DragEvent
- type DragExportData
- type DragResult
- type DragSourceStyle
- type DragState
- type DraggableElement
- type DrawerElement
- type DropEvent
- type DropState
- type DropTargetElement
- type DroppedFiles
- type Easing
- type Element
- type Emoji
- type EmojiPickerElement
- type ExpandState
- type Fit
- type FlexDirection
- type FontFile
- type FontStyle
- type FontWeight
- type IconButtonElement
- type IconButtonVariant
- type IconDocument
- type IconPath
- type IconRegistry
- type IconSource
- type IconVGIcon
- type ImageElement
- type InputAPI
- type InputElement
- type Inset
- type Justify
- type KeyEvent
- type KeyModifiers
- type KeyName
- type KeyShortcut
- type KeyState
- type Keyboard
- type KeyboardInputElement
- type KeyedCache
- type Keyframe
- type KeyframeAnimation
- type Landmark
- type LazyAlign
- type LazyAnchor
- type LazyListElement
- type License
- type LicensesElement
- type LinearGradient
- type LiveMode
- type MarkdownOptions
- type MaxLines
- type MemoCache
- type MentionsElement
- type MenuElement
- type MenuItem
- type Mode
- type MouseButton
- type MultiSelectElement
- type NamedKey
- type NumberInputElement
- type OutOfFlow
- type Overflow
- type PaginationElement
- type Painter
- type Palette
- type PaletteCommand
- type Placement
- type Platform
- type PlatformViews
- type Position
- type PressState
- type PressableElement
- type ProgressElement
- type RawFunc
- type RichEditorElement
- type RichSubmitMode
- type RichSuggester
- type RichSuggestion
- type RichTextElement
- type RichTextSpan
- type Route
- type Router
- type ScrollAlign
- type ScrollAnchor
- type ScrollAxis
- type ScrollBar
- type ScrollElement
- type SegmentedElement
- type SelectElement
- type SemanticContainer
- type SemanticKind
- type SemanticNode
- type SheetElement
- type SheetMode
- type Side
- type SkipLinkElement
- type SliderElement
- type SpinnerElement
- type SplitAxis
- type SplitPaneElement
- type State
- type StyleTransition
- type Styles
- type SubmitMode
- type SwipeAction
- type SwipeableElement
- type SwitchElement
- type Tab
- type TabWidth
- type TabsElement
- type TerminalElement
- type TerminalPalette
- type TextAlign
- type TextAnchor
- type TextDecoration
- type TextElement
- type TextOverflow
- type TextTransform
- type TimeOfDay
- type TimePickerElement
- type TitleBarButton
- type TitleBarElement
- type TitleBarPlacement
- type TitleBarVariant
- type TitleBarWindow
- type ToastKind
- type ToastPlacement
- type ToasterElement
- type TooltipElement
- type Transform
- type TransitionElement
- type TransitionKind
- type TreeNode
- type TreeRowState
- type TreeViewElement
- type VirtualListElement
- type Visibility
- type Watch
- type Wrap
- type ZoomElement
Constants ¶
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.
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).
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 )
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 )
const ( VariantContained = button.VariantContained VariantOutlined = button.VariantOutlined VariantGhost = button.VariantGhost IconButtonContained = iconbutton.VariantContained IconButtonOutlined = iconbutton.VariantOutlined IconButtonGhost = iconbutton.VariantGhost )
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.
const ( ChartLegendAuto = chart.LegendAuto ChartLegendNone = chart.LegendNone ChartLegendTop = chart.LegendTop ChartLegendBottom = chart.LegendBottom )
Chart legend positions.
const ( RichSubmitNone = richedit.SubmitNone RichSubmitEnter = richedit.SubmitEnter RichSubmitShortcut = richedit.SubmitShortcut )
What Enter does in a RichEditor.
const ( CalendarMonth = calendarview.Month CalendarWeek = calendarview.Week CalendarDay = calendarview.Day CalendarAgenda = calendarview.Agenda )
const ( SheetNever = dropdown.SheetNever SheetCompact = dropdown.SheetCompact SheetAlways = dropdown.SheetAlways )
const ( Vertical = scroll.Vertical Horizontal = scroll.Horizontal AnchorTop = scroll.AnchorTop AnchorBottom = scroll.AnchorBottom )
const ( SubmitDefault = input.SubmitDefault SubmitEnter = input.SubmitEnter SubmitEnterUnlessShift = input.SubmitEnterUnlessShift SubmitNever = input.SubmitNever )
const ( DetentFit = sheet.DetentFit DetentMedium = sheet.DetentMedium DetentLarge = sheet.DetentLarge )
const ( KeyboardText = input.KeyboardText KeyboardNumeric = input.KeyboardNumeric KeyboardEmail = input.KeyboardEmail KeyboardURL = input.KeyboardURL KeyboardPhone = input.KeyboardPhone )
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 )
const ( ModeLight = properties.ModeLight ModeDark = properties.ModeDark )
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 )
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 )
const ( // PlaceAuto puts it below the trigger, or above when it doesn't fit. PlaceAuto = elements.PlaceAuto PlaceBelow = elements.PlaceBelow PlaceAbove = elements.PlaceAbove )
const ( ScrollAlignNearest = virtuallist.AlignNearest ScrollAlignStart = virtuallist.AlignStart ScrollAlignCenter = virtuallist.AlignCenter ScrollAlignEnd = virtuallist.AlignEnd )
const ( LazyAnchorTop = lazylist.AnchorTop LazyAnchorBottom = lazylist.AnchorBottom LazyAlignStart = lazylist.AlignStart LazyAlignCenter = lazylist.AlignCenter LazyAlignEnd = lazylist.AlignEnd )
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 )
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 )
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).
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.
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.
const ( SplitHorizontal = splitpane.Horizontal SplitVertical = splitpane.Vertical )
const OverlayMargin = kit.Margin
OverlayMargin is the default distance kept between an overlay and the window edges.
Variables ¶
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 )
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 )
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 )
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 )
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.
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 )
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 )
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 )
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.
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 Aside = appshell.Aside // 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 )
var ( Scale = kit.Scale Hovered = kit.Hovered Pressed = kit.Pressed Alpha = kit.Alpha ClampPos = kit.ClampPos )
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 )
var CalendarView = calendarview.New
CalendarView creates a calendar of events by month, week, day or agenda; see calendarview.CalendarView.
var Chart = chart.New
Chart creates a chart of a kind; see chart.Chart.
var ChartTimeX = chart.TimeX
ChartTimeX converts a time to a ChartPoint X on a time axis.
var DateCalendar = datepicker.NewCalendar
DateCalendar creates a month calendar to pick a day or a range from; see datepicker.DateCalendar.
var FormatNumber = chart.FormatNumber
FormatNumber writes a number compactly: 1.2k, 3.4M.
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.
var KeyModShortcut = key.ModShortcut
KeyModShortcut is Command on Apple platforms and Ctrl elsewhere.
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)
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.
var NewRouter = router.New
var RichEditor = richedit.New
RichEditor creates a rich text editor; see richedit.RichEditor. Its document model is package richdoc.
var Sparkline = chart.Sparkline
Sparkline draws a small line of values without axes.
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")
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.
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)
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.
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 ¶
DragAccept returns a DropTarget.Accept predicate for payloads of type T.
func DragPayload ¶
DragPayload returns a drop's payload as a T.
func Frame ¶
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 ¶
InsertItem inserts v at slot i and returns the slice; RemoveItem removes s[i].
func Keyed ¶
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 ¶
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 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),
)
Types ¶
type AccordionElement ¶
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 AppShellSlot ¶
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 ¶
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 ¶
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 ButtonVariant ¶
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 ¶
Style value and element types, for declaring variables and helpers that take them.
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 ¶
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 ¶
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 ¶
ComboOption is a Combobox, MultiSelect or Mentions option.
type ComboSource ¶
ComboSource fetches options for a query, for options on a server.
type ComboboxElement ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 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 ¶
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 ¶
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 ¶
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 DataGridSorter ¶
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 ¶
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 DialogElement ¶
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 DocTabsElement ¶
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 ¶
DragState is a Draggable's state for its content, DropState a DropTarget's; DropEvent is a drop, DragResult how a drag ended.
type DraggableElement ¶
DraggableElement is content that can be dragged (Draggable); DropTargetElement an area drags can be dropped on (DropTarget). See the dnd package.
type DrawerElement ¶
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 DropTargetElement ¶
type DropTargetElement = dnd.DropTarget
type DroppedFiles ¶
DroppedFiles is the payload of files dragged in from other applications, for drop targets (Config.FileDropTargets).
type Easing ¶
type Easing = properties.Easing
type Element ¶
func NoWindowDrag ¶
NoWindowDrag keeps el, inside a WindowDragArea, from dragging the window, so a press on it reaches it.
func WindowDragArea ¶
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 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 IconRegistry ¶
type IconSource ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
KeyShortcut is a keyboard shortcut made with Shortcut.
type KeyState ¶
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 ¶
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 KeyframeAnimation ¶
type KeyframeAnimation = elements.KeyframeAnimation
KeyframeAnimation plays styles through keyframes on a Box (BoxElement.Animation); Keyframe is one of its steps.
type LazyAnchor ¶
type LazyListElement ¶
type 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 ¶
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 MaxLines ¶
type MaxLines = properties.MaxLines
Style value and element types, for declaring variables and helpers that take them.
type MentionsElement ¶
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 ¶
MenuElement is a Menu: a context menu, a menu bar's menu, or a DocTabs tab menu to add items to.
type MenuItem ¶
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 ¶
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 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 Palette ¶
type Palette = properties.Palette
type PaletteCommand ¶
PaletteCommand is a CommandPalette command.
type Placement ¶
Placement is the side of its trigger a tooltip (or any portal placed with elements.RegisterPortalAround) goes.
type Platform ¶
Platform is a set of platforms, for OnlyOn and IsPlatform; PlatformViews an element per platform, for ByPlatform.
type PlatformViews ¶
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 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 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 ¶
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 ¶
RichTextSpan is one run of a RichText paragraph, made with Span or Link.
type ScrollAlign ¶
type ScrollAlign = virtuallist.Align
type ScrollAnchor ¶
ScrollAxis selects the directions a Scroll scrolls in, and ScrollAnchor where it keeps growing content; see scroll.Scroll.Axis and Anchor.
type ScrollAxis ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SheetMode selects when a Select opens as a bottom sheet; see dropdown.Select.Sheet.
type SkipLinkElement ¶
SkipLinkElement is the link SkipLink returns.
type SliderElement ¶
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 ¶
SplitPaneElement is the element SplitPane returns; SplitAxis how its panes are placed.
type SplitPaneElement ¶
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 ¶
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 ¶
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.
type StyleTransition ¶
type StyleTransition = properties.Transition
type SubmitMode ¶
type SubmitMode = input.SubmitMode
SubmitMode selects which keys submit an Input; see input.Input.SubmitOn.
type SwipeAction ¶
SwipeAction is a button revealed behind a Swipeable row.
type SwipeableElement ¶
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 ¶
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 TabWidth ¶
type TabWidth = properties.TabWidth
Style value and element types, for declaring variables and helpers that take them.
type TabsElement ¶
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 ¶
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 ¶
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 TitleBarElement ¶
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 TitleBarWindow ¶
type ToastPlacement ¶
type ToasterElement ¶
type TooltipElement ¶
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 TreeRowState ¶
type TreeViewElement ¶
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 ¶
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).