Documentation
¶
Overview ¶
Package astryx provides composable native Go UI components for MyGo.
Create a UI builder with New during each view build, or use Scope to apply a theme to an entire subtree. Builders, elements and component parts belong to that build pass; keep model state and ui.Handle values in your app. Stateful components should receive their identity through Context.Key before construction. The module path is local until a publishing repository is chosen.
Index ¶
- Variables
- func AddUploadPaths(state *FileInputState, paths []string, o FileInputOptions) bool
- func Scope(c *ui.Context, tokens theme.Theme, build func(*UI)) ui.Element
- func ValidateDateRange(value DateRange, o DateRangeOptions) string
- type AlertDialogOptions
- type AvatarGroupOptions
- type AvatarOptions
- type AvatarStatusOptions
- type BannerOptions
- type Breadcrumb
- type ButtonOptions
- type CardOptions
- type CarouselOptions
- type CarouselSlide
- type ChatComposerInputOptions
- type ChatDraft
- type ChatMessageData
- type ChatMessageOptions
- type ChatOptions
- type ChatReaction
- type ChatState
- type ChatTextRun
- type ChatToken
- type ChatToolCall
- type ChoiceOptions
- type CitationOptions
- type Command
- type CommandPaletteOptions
- type CommandPaletteState
- type ContextMenuOptions
- type DateRange
- type DateRangeOptions
- type DateRangePreset
- type DialogOptions
- type DictationOptions
- type DictationState
- type Disclosure
- type FileInputOptions
- type FileInputState
- type FilterField
- type HoverCardOptions
- type ImageAsset
- type IndicatorOptions
- type IndicatorState
- type InputOptions
- type ItemOptions
- type LayoutSlots
- type MarkdownOptions
- type MenuEntry
- type Metadata
- type NavItem
- type NavOptions
- type Option
- type OutlineItem
- type OverlayOptions
- type Person
- type PowerSearchOptions
- type PowerSearchState
- type ResizableOptions
- type ResizableState
- type ScrollOptions
- type SearchFilter
- type SelectionOptions
- type Size
- type Step
- type StepperOptions
- type Suggestion
- type ThumbnailOptions
- type TimerOptions
- type TimerState
- type TimestampOptions
- type Tone
- type TypeaheadOptions
- type TypeaheadState
- type UI
- func (k *UI) Accordion(items []Disclosure) ui.Element
- func (k *UI) Alert(title, description string, tones ...Tone) ui.Element
- func (k *UI) AlertDialog(title, description string, open *bool, options ...AlertDialogOptions) ui.Element
- func (k *UI) AppShell(navigation, content func()) ui.Element
- func (k *UI) AspectRatio(ratio float32) ui.Element
- func (k *UI) Avatar(name string, image *ui.Bitmap, options ...AvatarOptions) ui.Element
- func (k *UI) AvatarGroup(people []Person, maximum int, options ...AvatarGroupOptions) ui.Element
- func (k *UI) AvatarGroupOverflow(count int, options ...AvatarGroupOptions) ui.Element
- func (k *UI) AvatarStatusDot(label string, tone Tone, options ...AvatarStatusOptions) ui.Element
- func (k *UI) Badge(text string, tones ...Tone) ui.Element
- func (k *UI) Banner(title, description string, options ...BannerOptions) ui.Element
- func (k *UI) Blockquote(text, attribution string) ui.Element
- func (k *UI) BottomSheet(title string, open *bool, content func(), options ...DialogOptions) ui.Element
- func (k *UI) Breadcrumbs(items []Breadcrumb) ui.Element
- func (k *UI) Button(label string, options ...ButtonOptions) ui.Element
- func (k *UI) ButtonGroup(build func()) ui.Element
- func (k *UI) Calendar(value *time.Time) ui.Element
- func (k *UI) Caption(text string) ui.Element
- func (k *UI) Card(options ...CardOptions) ui.Element
- func (k *UI) Carousel(index *int, slides []CarouselSlide, options ...CarouselOptions) ui.Element
- func (k *UI) Center() ui.Element
- func (k *UI) Chat(state *ChatState, options ...ChatOptions) ui.Element
- func (k *UI) ChatComposer(state *ChatState, options ...ChatOptions) ui.Element
- func (k *UI) ChatComposerDrawer(label string, open *bool, content func()) ui.Element
- func (k *UI) ChatComposerInput(value *string, options ...ChatComposerInputOptions) ui.Element
- func (k *UI) ChatComposerTokenElement(token ChatToken, onRemove func()) ui.Element
- func (k *UI) ChatDictationButton(state *DictationState, options ...DictationOptions) ui.Element
- func (k *UI) ChatLayout(messages, composer func()) ui.Element
- func (k *UI) ChatLayoutScrollButton(state *ui.ListState, label string) ui.Element
- func (k *UI) ChatMessage(message *ChatMessageData, options ...ChatMessageOptions) ui.Element
- func (k *UI) ChatMessageBubble(message ChatMessageData) ui.Element
- func (k *UI) ChatMessageList(state *ui.ListState, messages []ChatMessageData, options ...ChatMessageOptions) ui.Element
- func (k *UI) ChatMessageMetadata(message ChatMessageData) ui.Element
- func (k *UI) ChatSendButton(busy, canSend bool, onSend, onStop func()) ui.Element
- func (k *UI) ChatSystemMessage(text string) ui.Element
- func (k *UI) ChatTokenizedText(runs []ChatTextRun) ui.Element
- func (k *UI) ChatToolCalls(calls []ChatToolCall) ui.Element
- func (k *UI) CheckIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
- func (k *UI) Checkbox(value *bool, label string, options ...ChoiceOptions) ui.Element
- func (k *UI) CheckboxIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
- func (k *UI) CheckboxList(values *[]string, items []Option, options ...SelectionOptions) ui.Element
- func (k *UI) Citation(label string, options ...CitationOptions) ui.Element
- func (k *UI) ClickableCard(label string, build func(), options ...CardOptions) ui.Element
- func (k *UI) Code(text string) ui.Element
- func (k *UI) CodeBlock(source, language string) ui.Element
- func (k *UI) Collapsible(label string, open *bool, build func()) ui.Element
- func (k *UI) ColorPicker(value *ui.Color) ui.Element
- func (k *UI) Combobox(value *string, items []string, options ...InputOptions) ui.Element
- func (k *UI) CommandPalette(open *bool, state *CommandPaletteState, items []Command, ...) ui.Element
- func (k *UI) ComplexSelector(label string, open *bool, summary string, content func(close func()), ...) ui.Element
- func (k *UI) Container() ui.Element
- func (k *UI) ContextMenu(target ui.Element, entries []MenuEntry, options ...ContextMenuOptions) ui.Element
- func (k *UI) DateInput(value *time.Time) ui.Element
- func (k *UI) DateRangeInput(value *DateRange, options ...DateRangeOptions) ui.Element
- func (k *UI) DateTimeInput(value *time.Time, options ...InputOptions) ui.Element
- func (k *UI) Dialog(title string, open *bool, content func(), options ...DialogOptions) ui.Element
- func (k *UI) Divider() ui.Element
- func (k *UI) Drawer(title string, open *bool, content func(), options ...DialogOptions) ui.Element
- func (k *UI) DropdownMenu(label string, entries []MenuEntry, options ...ButtonOptions) ui.Element
- func (k *UI) EmptyState(title, description string, action func()) ui.Element
- func (k *UI) Field(label string, build func(), options ...InputOptions) ui.Element
- func (k *UI) FieldStatus(message string, tone Tone) ui.Element
- func (k *UI) Fieldset(legend string, build func()) ui.Element
- func (k *UI) FileInput(state *FileInputState, options ...FileInputOptions) ui.Element
- func (k *UI) Form(build func()) ui.Element
- func (k *UI) FormLayout(columns int) ui.Element
- func (k *UI) Grid(columns int) ui.Element
- func (k *UI) GridSpan(columns int) ui.Element
- func (k *UI) HStack() ui.Element
- func (k *UI) Heading(text string, level int) ui.Element
- func (k *UI) HoverCard(anchor ui.Element, content func(), options ...HoverCardOptions) ui.Element
- func (k *UI) Icon(icon *ui.SVG) ui.Element
- func (k *UI) IconButton(label string, icon *ui.SVG, options ...ButtonOptions) ui.Element
- func (k *UI) Indicator(state IndicatorState, options ...IndicatorOptions) ui.Element
- func (k *UI) InfoTip(label, description string) ui.Element
- func (k *UI) Inline() ui.Element
- func (k *UI) InputClearButton(value *string, focus *ui.Handle, options ...ButtonOptions) ui.Element
- func (k *UI) InputGroup(value *string, leading, trailing func(), options ...InputOptions) ui.Element
- func (k *UI) Item(label string, options ...ItemOptions) ui.Element
- func (k *UI) Kbd(keys string) ui.Element
- func (k *UI) Key(id any) *UI
- func (k *UI) Layout(slots LayoutSlots) ui.Element
- func (k *UI) Lightbox(open *bool, index *int, images []ImageAsset) ui.Element
- func (k *UI) Link(label, url string) ui.Element
- func (k *UI) List(state *ui.ListState, count int, row func(int)) ui.Element
- func (k *UI) Markdown(source string, options ...MarkdownOptions) ui.Element
- func (k *UI) MetadataList(items []Metadata) ui.Element
- func (k *UI) MobileNav(selected *string, items []NavItem) ui.Element
- func (k *UI) MobileNavToggle(label string, open *bool, options ...ButtonOptions) ui.Element
- func (k *UI) MoreMenu(label string, entries []MenuEntry) ui.Element
- func (k *UI) MultiSelector(values *[]string, items []Option, options ...SelectionOptions) ui.Element
- func (k *UI) NavMenu(label string, entries []MenuEntry) ui.Element
- func (k *UI) NumberInput(value *float64, low, high, step float64, options ...InputOptions) ui.Element
- func (k *UI) Outline(selected *string, items []OutlineItem, onNavigate func(string)) ui.Element
- func (k *UI) OverflowList(items []NavItem, visible int, onSelect func(string)) ui.Element
- func (k *UI) Overlay(open *bool, build func(), options ...OverlayOptions) ui.Element
- func (k *UI) Pagination(page *int, pages int) ui.Element
- func (k *UI) Popover(anchor ui.Element, open *bool, content func()) ui.Element
- func (k *UI) PowerSearch(state *PowerSearchState, fields []FilterField, options ...PowerSearchOptions) ui.Element
- func (k *UI) Progress(value float64) ui.Element
- func (k *UI) Radio(value *string, choice, label string, options ...ChoiceOptions) ui.Element
- func (k *UI) RadioGroup(label string, build func()) ui.Element
- func (k *UI) RadioIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
- func (k *UI) RadioList(value *string, items []Option, options ...InputOptions) ui.Element
- func (k *UI) RangeSlider(lowValue, highValue *float64, low, high, step float64) ui.Element
- func (k *UI) Rating(value *int, maximum int) ui.Element
- func (k *UI) Resizable(state *ResizableState, first, second func(), options ...ResizableOptions) ui.Element
- func (k *UI) Scroll(options ...ScrollOptions) ui.Element
- func (k *UI) SearchField(value *string, options ...InputOptions) ui.Element
- func (k *UI) Section(title, description string, build func()) ui.Element
- func (k *UI) Segmented(selected *int, labels []string) ui.Element
- func (k *UI) Select(value *string, items []Option, options ...InputOptions) ui.Element
- func (k *UI) SelectableCard(selected *bool, label string, build func()) ui.Element
- func (k *UI) SideNav(selected *string, items []NavItem, options ...NavOptions) ui.Element
- func (k *UI) Sidebar(selected *string, items []NavItem) ui.Element
- func (k *UI) Skeleton(width, height float32) ui.Element
- func (k *UI) Slider(value *float64, low, high float64, options ...InputOptions) ui.Element
- func (k *UI) Spacer() ui.Element
- func (k *UI) Spinner() ui.Element
- func (k *UI) Split(position *float32, first, second func()) ui.Element
- func (k *UI) Stack() ui.Element
- func (k *UI) StatusDot(label string, tone Tone) ui.Element
- func (k *UI) Stepper(current *int, steps []Step, options ...StepperOptions) ui.Element
- func (k *UI) Switch(value *bool, label string, options ...ChoiceOptions) ui.Element
- func (k *UI) Table(state *ui.ListState, columns []ui.TableColumn, count int, ...) ui.Element
- func (k *UI) Tabs(selected *int, labels []string) ui.Element
- func (k *UI) Text(text string) ui.Element
- func (k *UI) TextArea(value *string, options ...InputOptions) ui.Element
- func (k *UI) TextInput(value *string, options ...InputOptions) ui.Element
- func (k *UI) Thumbnail(image ImageAsset, options ...ThumbnailOptions) ui.Element
- func (k *UI) TimeInput(value *time.Time) ui.Element
- func (k *UI) Timer(state *TimerState, options ...TimerOptions) ui.Element
- func (k *UI) Timestamp(value time.Time, options ...TimestampOptions) ui.Element
- func (k *UI) Toast(message ui.Toast) string
- func (k *UI) ToastViewport() ui.Element
- func (k *UI) Toggle(on *bool, label string, options ...ButtonOptions) ui.Element
- func (k *UI) Token(label string, onRemove func()) ui.Element
- func (k *UI) Tokenizer(values *[]string, suggestions []string, options ...InputOptions) ui.Element
- func (k *UI) Tokens() theme.Theme
- func (k *UI) Toolbar(label string, build func()) ui.Element
- func (k *UI) Tooltip(anchor ui.Element, description string) ui.Element
- func (k *UI) TopNav(selected *string, items []NavItem, options ...NavOptions) ui.Element
- func (k *UI) TopNavMegaMenu(label string, items, featured func(), options ...HoverCardOptions) ui.Element
- func (k *UI) TopNavMegaMenuItem(label string, options ...ItemOptions) ui.Element
- func (k *UI) Tree(build func()) ui.Element
- func (k *UI) TreeItem(label string, open *bool, build func()) ui.Element
- func (k *UI) TreeList(state *ui.OutlineState[string], roots []string, children func(string) []string, ...) ui.Element
- func (k *UI) Typeahead(state *TypeaheadState, items []Suggestion, options ...TypeaheadOptions) ui.Element
- func (k *UI) VisuallyHidden(text string) ui.Element
- type UploadFile
- type Variant
Constants ¶
This section is empty.
Variables ¶
var ( IconPlus = mustIcon(`<path d="M12 5v14M5 12h14"/>`) IconMinus = mustIcon(`<path d="M5 12h14"/>`) IconClose = mustIcon(`<path d="m6 6 12 12M18 6 6 18"/>`) IconCheck = mustIcon(`<path d="m5 12.5 4.5 4.5L19 7.5"/>`) IconChevronDown = mustIcon(`<path d="m6 9 6 6 6-6"/>`) IconChevronRight = mustIcon(`<path d="m9 6 6 6-6 6"/>`) IconChevronLeft = mustIcon(`<path d="m15 6-6 6 6 6"/>`) IconMore = mustIcon(`<circle cx="5" cy="12" r="1.2" fill="currentColor"/><circle cx="12" cy="12" r="1.2" fill="currentColor"/><circle cx="19" cy="12" r="1.2" fill="currentColor"/>`) IconCopy = mustIcon(`<rect x="9" y="9" width="10" height="10" rx="2"/><path d="M15 9V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"/>`) IconInfo = mustIcon(`<circle cx="12" cy="12" r="9"/><path d="M12 16v-4M12 8h.01"/>`) IconUpload = mustIcon(`<path d="M12 15V4m0 0-4 4m4-4 4 4M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-1"/>`) IconSearch = mustIcon(`<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 5 5"/>`) IconArrow = mustIcon(`<path d="M5 12h14m-6-6 6 6-6 6"/>`) IconSettings = mustIcon(`<path d="M4 7h16M4 17h16"/><circle cx="8" cy="7" r="3"/><circle cx="16" cy="17" r="3"/>`) )
These original outline icons use the current text color. They are provided for examples and common actions; callers can supply any MyGo SVG.
Functions ¶
func AddUploadPaths ¶
func AddUploadPaths(state *FileInputState, paths []string, o FileInputOptions) bool
func Scope ¶
Scope builds a themed subtree. Its floating panels inherit this theme too. The returned container can be sized with ordinary MyGo element methods.
func ValidateDateRange ¶
func ValidateDateRange(value DateRange, o DateRangeOptions) string
Types ¶
type AlertDialogOptions ¶
type AvatarGroupOptions ¶
type AvatarOptions ¶
type AvatarStatusOptions ¶
type BannerOptions ¶
type Breadcrumb ¶
type ButtonOptions ¶
type ButtonOptions struct {
Variant Variant
Size Size
Disabled, Loading bool
Icon, EndIcon *ui.SVG
}
ButtonOptions configures a button at construction. Native element methods remain available on the returned element for layout and event handling.
type CardOptions ¶
type CarouselOptions ¶
type CarouselSlide ¶
type CarouselSlide struct {
ID, Label string
Content func()
}
type ChatComposerInputOptions ¶
type ChatComposerInputOptions struct {
InputOptions
MultilineEnter bool
OnSend func(string) bool
}
type ChatMessageData ¶
type ChatMessageData struct {
ID, Role, Author, Text, Status, Reasoning string
Time time.Time
Streaming, ReasoningOpen bool
Tools []ChatToolCall
Reactions []ChatReaction
Tokens []ChatToken
}
type ChatMessageOptions ¶
type ChatOptions ¶
type ChatOptions struct {
Placeholder string
Disabled, ReadOnly, MultilineEnter bool
OnSend func(ChatDraft) error
OnStop func()
Extras func()
MessageOptions ChatMessageOptions
}
type ChatReaction ¶
type ChatTextRun ¶
type ChatToolCall ¶
type ChoiceOptions ¶
type CitationOptions ¶
type CitationOptions struct {
Detail, URL string
OnClick func()
}
type CommandPaletteOptions ¶
type CommandPaletteState ¶
type ContextMenuOptions ¶
type ContextMenuOptions struct{ Native bool }
type DateRangeOptions ¶
type DateRangePreset ¶
type DialogOptions ¶
type DictationOptions ¶
type DictationOptions struct{ Start, Stop func() error }
type DictationState ¶
Dictation is a UI/service boundary. Native speech recognition is supplied by the host application; without both callbacks this control stays unavailable.
type Disclosure ¶
type FileInputOptions ¶
type FileInputState ¶
type FileInputState struct {
Files []UploadFile
Error string
Busy bool
Progress float64
// contains filtered or unexported fields
}
type FilterField ¶
type HoverCardOptions ¶
type ImageAsset ¶
type ImageAsset struct {
ID, Label string
Source ui.ImageSource
}
type IndicatorOptions ¶
type IndicatorState ¶
type IndicatorState string
const ( IndicatorUnchecked IndicatorState = "unchecked" IndicatorChecked IndicatorState = "checked" IndicatorMixed IndicatorState = "mixed" )
type InputOptions ¶
type ItemOptions ¶
type LayoutSlots ¶
type LayoutSlots struct {
PanelWidth float32
}
type MarkdownOptions ¶
type MenuEntry ¶
type MenuEntry struct {
ID, Label string
Group string
Disabled, Separator bool
Checked *bool
Radio *string
Value string
Children []MenuEntry
Modifiers ui.Modifiers
Shortcut ui.Key
OnSelect func()
}
MenuEntry is a stable, application-owned menu model. Checked and Radio bindings allow controlled checkbox/radio items; Children creates a submenu.
type NavOptions ¶
type NavOptions struct {
}
type OutlineItem ¶
type OverlayOptions ¶
type PowerSearchOptions ¶
type PowerSearchOptions struct {
Label string
Disabled, ReadOnly bool
OnChange func([]SearchFilter)
}
type PowerSearchState ¶
type PowerSearchState struct {
Query string
Filters []SearchFilter
Field, Operator, Value, Editing, Error string
// contains filtered or unexported fields
}
type ResizableOptions ¶
type ResizableState ¶
type ScrollOptions ¶
type ScrollOptions struct{ Horizontal, Both bool }
type SearchFilter ¶
type SelectionOptions ¶
type StepperOptions ¶
type Suggestion ¶
type ThumbnailOptions ¶
type TimerOptions ¶
type TimerState ¶
type TimerState struct {
Elapsed time.Duration
Running bool
// contains filtered or unexported fields
}
TimerState is an application-owned stopwatch model. Start/Pause use the caller's clock, which also makes tests deterministic.
func (*TimerState) Pause ¶
func (s *TimerState) Pause(now time.Time)
func (*TimerState) Reset ¶
func (s *TimerState) Reset()
func (*TimerState) Start ¶
func (s *TimerState) Start(now time.Time)
type TimestampOptions ¶
type TypeaheadOptions ¶
type TypeaheadOptions struct {
InputOptions
OnSelect func(Suggestion)
OnQuery func(string)
}
type TypeaheadState ¶
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI builds components in one MyGo build pass. Do not store it in app state.
func (*UI) AlertDialog ¶
func (*UI) AppShell ¶
AppShell creates an adaptive navigation/content shell with an immersive window title bar region. At narrow widths the navigation becomes a compact top section; neither callback is omitted.
func (*UI) Avatar ¶
Avatar composes the status into its accessible name. The status lives above the circular image's clipping boundary, so it stays visible at every size.
func (*UI) AvatarGroup ¶
func (*UI) AvatarGroupOverflow ¶
func (k *UI) AvatarGroupOverflow(count int, options ...AvatarGroupOptions) ui.Element
AvatarGroupOverflow keeps the true hidden count in the accessible label, even when the visible text is customized (for example, "99+").
func (*UI) AvatarStatusDot ¶
AvatarStatusDot distinguishes states by shape as well as color: filled for success, a ring for neutral, and a minus for danger.
func (*UI) Banner ¶
func (k *UI) Banner(title, description string, options ...BannerOptions) ui.Element
func (*UI) BottomSheet ¶
func (*UI) Breadcrumbs ¶
func (k *UI) Breadcrumbs(items []Breadcrumb) ui.Element
func (*UI) ButtonGroup ¶
func (*UI) Carousel ¶
func (k *UI) Carousel(index *int, slides []CarouselSlide, options ...CarouselOptions) ui.Element
func (*UI) ChatComposer ¶
func (k *UI) ChatComposer(state *ChatState, options ...ChatOptions) ui.Element
func (*UI) ChatComposerDrawer ¶
func (*UI) ChatComposerInput ¶
func (k *UI) ChatComposerInput(value *string, options ...ChatComposerInputOptions) ui.Element
func (*UI) ChatComposerTokenElement ¶
func (*UI) ChatDictationButton ¶
func (k *UI) ChatDictationButton(state *DictationState, options ...DictationOptions) ui.Element
func (*UI) ChatLayout ¶
func (*UI) ChatLayoutScrollButton ¶
func (*UI) ChatMessage ¶
func (k *UI) ChatMessage(message *ChatMessageData, options ...ChatMessageOptions) ui.Element
func (*UI) ChatMessageBubble ¶
func (k *UI) ChatMessageBubble(message ChatMessageData) ui.Element
func (*UI) ChatMessageList ¶
func (k *UI) ChatMessageList(state *ui.ListState, messages []ChatMessageData, options ...ChatMessageOptions) ui.Element
func (*UI) ChatMessageMetadata ¶
func (k *UI) ChatMessageMetadata(message ChatMessageData) ui.Element
func (*UI) ChatSendButton ¶
func (*UI) ChatTokenizedText ¶
func (k *UI) ChatTokenizedText(runs []ChatTextRun) ui.Element
func (*UI) ChatToolCalls ¶
func (k *UI) ChatToolCalls(calls []ChatToolCall) ui.Element
func (*UI) CheckIndicator ¶
func (k *UI) CheckIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
func (*UI) CheckboxIndicator ¶
func (k *UI) CheckboxIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
func (*UI) CheckboxList ¶
func (*UI) ClickableCard ¶
func (k *UI) ClickableCard(label string, build func(), options ...CardOptions) ui.Element
func (*UI) CodeBlock ¶
CodeBlock uses MyGo's Markdown renderer for native syntax highlighting, selection and the copy action. A longer fence prevents source injection.
func (*UI) Collapsible ¶
func (*UI) Combobox ¶
Combobox returns the editable input. It keeps MyGo's native text editing and keyboard selection; the model contains the selected or newly typed string.
func (*UI) CommandPalette ¶
func (k *UI) CommandPalette(open *bool, state *CommandPaletteState, items []Command, options ...CommandPaletteOptions) ui.Element
func (*UI) ComplexSelector ¶
func (k *UI) ComplexSelector(label string, open *bool, summary string, content func(close func()), options ...InputOptions) ui.Element
ComplexSelector delegates its popup body to the caller. The close callback captures only application state, so the caller may safely attach it to actions.
func (*UI) ContextMenu ¶
func (*UI) DateRangeInput ¶
func (k *UI) DateRangeInput(value *DateRange, options ...DateRangeOptions) ui.Element
func (*UI) DateTimeInput ¶
func (*UI) DropdownMenu ¶
func (*UI) EmptyState ¶
func (*UI) Field ¶
func (k *UI) Field(label string, build func(), options ...InputOptions) ui.Element
Field preserves MyGo's label-to-control and error-description relationships.
func (*UI) FileInput ¶
func (k *UI) FileInput(state *FileInputState, options ...FileInputOptions) ui.Element
func (*UI) IconButton ¶
IconButton requires a descriptive label, which is exposed to assistive tools.
func (*UI) Indicator ¶
func (k *UI) Indicator(state IndicatorState, options ...IndicatorOptions) ui.Element
Indicator is a decorative control visual, not a notification badge. Its parent remains responsible for role, state, keyboard and focus behavior.
func (*UI) InputClearButton ¶
func (*UI) InputGroup ¶
func (k *UI) InputGroup(value *string, leading, trailing func(), options ...InputOptions) ui.Element
InputGroup adds leading/trailing content around an IME-aware native input. The root is returned for layout; the input can be customized inside Field.
func (*UI) Key ¶
Key gives the next outer control a stable identity before it initializes state. It is equivalent to c.Key(id), and is intended for immediate chaining.
func (*UI) MobileNavToggle ¶
MobileNavToggle binds an application's drawer/sheet visibility. The same boolean must be passed to that surface so Escape and outside presses update the trigger's expanded state as well.
func (*UI) MultiSelector ¶
func (*UI) NumberInput ¶
func (k *UI) NumberInput(value *float64, low, high, step float64, options ...InputOptions) ui.Element
NumberInput and SearchField are themed adapters to MyGo's complete controls.
func (*UI) OverflowList ¶
func (*UI) Overlay ¶
func (k *UI) Overlay(open *bool, build func(), options ...OverlayOptions) ui.Element
func (*UI) Pagination ¶
Pagination uses one-based page numbers and clamps its model when totals shrink.
func (*UI) PowerSearch ¶
func (k *UI) PowerSearch(state *PowerSearchState, fields []FilterField, options ...PowerSearchOptions) ui.Element
func (*UI) RadioIndicator ¶
func (k *UI) RadioIndicator(state IndicatorState, options ...IndicatorOptions) ui.Element
func (*UI) RangeSlider ¶
func (*UI) Resizable ¶
func (k *UI) Resizable(state *ResizableState, first, second func(), options ...ResizableOptions) ui.Element
func (*UI) SearchField ¶
func (k *UI) SearchField(value *string, options ...InputOptions) ui.Element
func (*UI) SelectableCard ¶
func (*UI) Skeleton ¶
Skeleton is deliberately static: idle placeholders do not keep the window rendering and are suitable for users who request reduced motion.
func (*UI) Table ¶
func (k *UI) Table(state *ui.ListState, columns []ui.TableColumn, count int, cell func(row, col int)) ui.Element
Table preserves MyGo's virtualized rows, selection, sorting and resizing. Configure ListState on the app model before calling Table.
func (*UI) Thumbnail ¶
func (k *UI) Thumbnail(image ImageAsset, options ...ThumbnailOptions) ui.Element
func (*UI) Timer ¶
func (k *UI) Timer(state *TimerState, options ...TimerOptions) ui.Element
func (*UI) Toast ¶
Toast queues a message. Call it in response to an action, not unconditionally in a view. Include ToastViewport once in the view for the custom appearance.
func (*UI) ToastViewport ¶
func (*UI) TopNavMegaMenu ¶
func (k *UI) TopNavMegaMenu(label string, items, featured func(), options ...HoverCardOptions) ui.Element
TopNavMegaMenu composes rich menu items with an optional featured panel. Pointer and keyboard users get the same content; narrow windows use a drawer.
func (*UI) TopNavMegaMenuItem ¶
func (k *UI) TopNavMegaMenuItem(label string, options ...ItemOptions) ui.Element
TopNavMegaMenuItem closes its containing mega menu before running the host action. Ordinary Item remains suitable for controls that should keep it open.
func (*UI) Typeahead ¶
func (k *UI) Typeahead(state *TypeaheadState, items []Suggestion, options ...TypeaheadOptions) ui.Element
type UploadFile ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gallery
command
Gallery is the native component explorer.
|
Gallery is the native component explorer. |
|
examples
|
|
|
basic
command
A small consumer of the public library, independent of Gallery internals.
|
A small consumer of the public library, independent of Gallery internals. |
|
internal
|
|
|
catalog
Package catalog is the shared index for the Gallery and component docs.
|
Package catalog is the shared index for the Gallery and component docs. |
|
gallery
Package gallery is the native, interactive component showcase.
|
Package gallery is the native, interactive component showcase. |
|
Package theme defines semantic design tokens and their MyGo theme mapping.
|
Package theme defines semantic design tokens and their MyGo theme mapping. |