Documentation
¶
Overview ¶
Package ui gives TSX nsgo/ui, package ui's components as Go components, for an app that imports this package for its effect; a theme of its own needs ui's roles, as core.DefaultTheme and ui.WarmDuskTheme have.
Each takes its Go fields as props (tsx.Register): variants by name, and icons as a name Icons gives or an SVG document. Generic components take string values. What a Go app holds in Go values a JS app holds in props: a List's and a Tree's selection are lists of keys, a Tree's items are data, and toasts go through the ref of Toasts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type List ¶
type List struct {
Count func() int
Key func(i int) string
Row func(cx *core.Scope, index func() int) core.Node
Multiple bool
Selected func() []string
OnSelectedChange func(selected []string)
OnActivate func(index int)
TapSelects bool
RowLabel func(i int) string
Columns int
EstimatedSize core.Points
Gap core.Points
Header core.Node
Empty core.Node
OnLoadMore func()
Label string
Ref *core.Ref
TestID string
Style core.Style
RowStyle core.Style
}
List is ui.List: Row gets a row's index, Key names rows, by their index when nil, and the selection is those names.
type ShellTab ¶
type ShellTab struct {
Text string
TextFunc func() string
Icon func() *core.SVG
SystemIcon string
Badge func() core.TabBadge
Content core.Node
TestID string
}
ShellTab is a tab of a TabShell.
type TabShell ¶
type TabShell struct {
Tabs []ShellTab
Selected func() int
OnChange func(index int)
Edge core.TabBarEdge
EdgeFunc func() core.TabBarEdge
Label string
LabelFunc func() string
TestID string
}
TabShell is ui.TabShell with each tab's Content a node.
type Toasts ¶
type Toasts struct {
Placement ui.ToastPlacement
Reverse bool
Swipe ui.ToastSwipe
Inset core.Points
CloseLabel string
// StyleFunc styles each toast through the reactive TSX style prop.
StyleFunc func() core.Style
Ref *ToastsRef
TestID string
}
Toasts is ui.Toasts with a toaster of its own, which its ref drives.
type ToastsRef ¶
type ToastsRef struct {
// contains filtered or unexported fields
}
ToastsRef is what the ref of Toasts gets.
type Tree ¶
type Tree struct {
Items func() []TreeNode
DefaultExpanded []string
Selected func() []string
OnSelectedChange func(selected []string)
OnActivate func(id string)
ToggleLabel string
EstimatedSize core.Points
Empty core.Node
Label string
TestID string
Style core.Style
}
Tree is ui.Tree of data: each of Items shows its Text after its Icon. It holds what is expanded itself, from DefaultExpanded, and the selection is the selected items' IDs.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package chat gives TSX nsgo/ui/chat, ui/chat's conversation components, for an app that imports this package for its effect beside tsx/ui.
|
Package chat gives TSX nsgo/ui/chat, ui/chat's conversation components, for an app that imports this package for its effect beside tsx/ui. |
|
Package richeditor gives TSX nsgo/ui's RichEditor, ui/richeditor's View over a RichEditorSession, which links packages other apps should not: an app whose TSX uses it imports this package for its effect.
|
Package richeditor gives TSX nsgo/ui's RichEditor, ui/richeditor's View over a RichEditorSession, which links packages other apps should not: an app whose TSX uses it imports this package for its effect. |