Documentation
¶
Index ¶
- Variables
- func ContextMenu(p ContextMenuProps) gx.Node
- func ContextMenuCheckboxItem(p ContextMenuCheckboxItemProps) gx.Node
- func ContextMenuCheckboxItemWrap(n gx.Node) gx.Node
- func ContextMenuGroup(p ContextMenuGroupProps) gx.Node
- func ContextMenuGroupWrap(n gx.Node) gx.Node
- func ContextMenuItem(p ContextMenuItemProps) gx.Node
- func ContextMenuItemWrap(n gx.Node) gx.Node
- func ContextMenuLabel(p ContextMenuLabelProps) gx.Node
- func ContextMenuLink(p ContextMenuLinkProps) gx.Node
- func ContextMenuLinkWrap(n gx.Node) gx.Node
- func ContextMenuRadioGroup(p ContextMenuRadioGroupProps) gx.Node
- func ContextMenuRadioGroupWrap(n gx.Node) gx.Node
- func ContextMenuRadioItem(p ContextMenuRadioItemProps) gx.Node
- func ContextMenuRadioItemWrap(n gx.Node) gx.Node
- func ContextMenuSeparator(p ContextMenuSeparatorProps) gx.Node
- func ContextMenuShortcut(p ContextMenuShortcutProps) gx.Node
- func ContextMenuSub(p ContextMenuSubProps) gx.Node
- func ContextMenuSubContent(p ContextMenuSubContentProps) gx.Node
- func ContextMenuSubContentWrap(n gx.Node) gx.Node
- func ContextMenuSubTrigger(p ContextMenuSubTriggerProps) gx.Node
- func ContextMenuSubTriggerWrap(n gx.Node) gx.Node
- func ContextMenuSubWrap(n gx.Node) gx.Node
- func ContextMenuTrigger(p ContextMenuTriggerProps) gx.Node
- type ContextMenuCheckboxItemProps
- type ContextMenuGroupProps
- type ContextMenuItemProps
- type ContextMenuLabelProps
- type ContextMenuLinkProps
- type ContextMenuProps
- type ContextMenuRadioGroupProps
- type ContextMenuRadioItemProps
- type ContextMenuSeparatorProps
- type ContextMenuShortcutProps
- type ContextMenuSubContentProps
- type ContextMenuSubProps
- type ContextMenuSubTriggerProps
- type ContextMenuTriggerProps
- type Variant
Constants ¶
This section is empty.
Variables ¶
var ContextMenuCheckboxItemFixtures = gx.Fixtures[ContextMenuCheckboxItemProps]{ "Checked": {Name: "status-bar", Checked: true, Children: gx.Text("Status bar")}, "Unchecked": {Name: "panel", Children: gx.Text("Panel")}, "Disabled": {Name: "activity", Disabled: true, Children: gx.Text("Activity bar")}, }
var ContextMenuFixtures = gx.Fixtures[ContextMenuProps]{ "Menu": {Id: "demo-context", Class: "w-52", Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Frag( gx.Text("Copy"), ContextMenuShortcut(ContextMenuShortcutProps{Children: gx.Text("⌘C")}), )}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Cut")}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuCheckboxItem(ContextMenuCheckboxItemProps{Name: "bookmarks", Checked: true, Children: gx.Text("Show bookmarks")}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuRadioGroup(ContextMenuRadioGroupProps{Label: "People", Children: gx.Frag( ContextMenuLabel(ContextMenuLabelProps{Inset: true, Children: gx.Text("People")}), ContextMenuRadioItem(ContextMenuRadioItemProps{Name: "demo-context-person", Value: "ada", Checked: true, Children: gx.Text("Ada")}), ContextMenuRadioItem(ContextMenuRadioItemProps{Name: "demo-context-person", Value: "grace", Children: gx.Text("Grace")}), )}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuLink(ContextMenuLinkProps{Href: gx.URL("/docs"), Children: gx.Text("Docs")}), ContextMenuItem(ContextMenuItemProps{Variant: Destructive, Children: gx.Text("Delete")}), )}, "Sub": {Id: "demo-context-sub", Class: "w-52", Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Back")}), ContextMenuSub(ContextMenuSubProps{Children: gx.Frag( ContextMenuSubTrigger(ContextMenuSubTriggerProps{Children: gx.Text("More tools")}), ContextMenuSubContent(ContextMenuSubContentProps{Class: "w-48", Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Save page")}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Create shortcut")}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Developer tools")}), )}), )}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Reload")}), )}, }
var ContextMenuGroupFixtures = gx.Fixtures[ContextMenuGroupProps]{ "Default": {Label: "Account", Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Profile")}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Billing")}), )}, }
var ContextMenuItemFixtures = gx.Fixtures[ContextMenuItemProps]{ "Item": {Children: gx.Text("Profile")}, "Inset": {Inset: true, Children: gx.Text("Profile")}, "Destructive": {Variant: Destructive, Children: gx.Text("Delete")}, "Disabled": {Disabled: true, Children: gx.Text("Profile")}, }
var ContextMenuLabelFixtures = gx.Fixtures[ContextMenuLabelProps]{ "Label": {Children: gx.Text("My account")}, "Inset": {Inset: true, Children: gx.Text("My account")}, }
var ContextMenuLinkFixtures = gx.Fixtures[ContextMenuLinkProps]{"Link": {Href: gx.URL("/docs"), Children: gx.Text("Documentation")}}
var ContextMenuRadioGroupFixtures = gx.Fixtures[ContextMenuRadioGroupProps]{ "Default": {Label: "Position", Children: gx.Frag( ContextMenuRadioItem(ContextMenuRadioItemProps{Name: "context-menu-group-position", Value: "top", Checked: true, Children: gx.Text("Top")}), ContextMenuRadioItem(ContextMenuRadioItemProps{Name: "context-menu-group-position", Value: "bottom", Children: gx.Text("Bottom")}), )}, }
var ContextMenuRadioItemFixtures = gx.Fixtures[ContextMenuRadioItemProps]{ "Checked": {Name: "context-menu-item-checked", Value: "top", Checked: true, Children: gx.Text("Top")}, "Unchecked": {Name: "context-menu-item-unchecked", Value: "bottom", Children: gx.Text("Bottom")}, }
var ContextMenuSeparatorFixtures = gx.Fixtures[ContextMenuSeparatorProps]{"Default": {}}
var ContextMenuShortcutFixtures = gx.Fixtures[ContextMenuShortcutProps]{"Default": {Children: gx.Text("⌘K")}}
var ContextMenuSubContentFixtures = gx.Fixtures[ContextMenuSubContentProps]{ "Content": {Class: "w-48", Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Save page")}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Create shortcut")}), ContextMenuSeparator(ContextMenuSeparatorProps{}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Developer tools")}), )}, }
var ContextMenuSubFixtures = gx.Fixtures[ContextMenuSubProps]{ "Default": {Children: gx.Frag( ContextMenuSubTrigger(ContextMenuSubTriggerProps{Children: gx.Text("More tools")}), ContextMenuSubContent(ContextMenuSubContentProps{Children: gx.Frag( ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Save page")}), ContextMenuItem(ContextMenuItemProps{Children: gx.Text("Create shortcut")}), )}), )}, }
var ContextMenuSubTriggerFixtures = gx.Fixtures[ContextMenuSubTriggerProps]{ "Trigger": {Children: gx.Text("More tools")}, "Inset": {Inset: true, Children: gx.Text("More tools")}, "Disabled": {Disabled: true, Children: gx.Text("More tools")}, }
var ContextMenuTriggerFixtures = gx.Fixtures[ContextMenuTriggerProps]{ "Default": { Id: "demo-context", Class: "flex h-[150px] w-[300px] items-center justify-center rounded-md border border-dashed border-border text-sm", Children: gx.Text("Right-click here"), }, "Sub": { Id: "demo-context-sub", Class: "flex h-[150px] w-[300px] items-center justify-center rounded-md border border-dashed border-border text-sm", Children: gx.Text("Right-click for a sub-menu"), }, }
Functions ¶
func ContextMenu ¶
func ContextMenu(p ContextMenuProps) gx.Node
func ContextMenuCheckboxItem ¶
func ContextMenuCheckboxItem(p ContextMenuCheckboxItemProps) gx.Node
func ContextMenuCheckboxItemWrap ¶
ContextMenuCheckboxItemWrap renders the item inside a menu, as a page uses it.
func ContextMenuGroup ¶
func ContextMenuGroup(p ContextMenuGroupProps) gx.Node
func ContextMenuGroupWrap ¶
ContextMenuGroupWrap renders the group inside a menu, as a page uses it.
func ContextMenuItem ¶
func ContextMenuItem(p ContextMenuItemProps) gx.Node
func ContextMenuItemWrap ¶
ContextMenuItemWrap renders the item inside a menu, as a page uses it.
func ContextMenuLabel ¶
func ContextMenuLabel(p ContextMenuLabelProps) gx.Node
func ContextMenuLink ¶
func ContextMenuLink(p ContextMenuLinkProps) gx.Node
func ContextMenuLinkWrap ¶
ContextMenuLinkWrap renders the item inside a menu, as a page uses it.
func ContextMenuRadioGroup ¶
func ContextMenuRadioGroup(p ContextMenuRadioGroupProps) gx.Node
func ContextMenuRadioGroupWrap ¶
ContextMenuRadioGroupWrap renders the group inside a menu, as a page uses it.
func ContextMenuRadioItem ¶
func ContextMenuRadioItem(p ContextMenuRadioItemProps) gx.Node
func ContextMenuRadioItemWrap ¶
ContextMenuRadioItemWrap renders the item inside a menu, as a page uses it.
func ContextMenuSeparator ¶
func ContextMenuSeparator(p ContextMenuSeparatorProps) gx.Node
func ContextMenuShortcut ¶
func ContextMenuShortcut(p ContextMenuShortcutProps) gx.Node
func ContextMenuSub ¶
func ContextMenuSub(p ContextMenuSubProps) gx.Node
func ContextMenuSubContent ¶
func ContextMenuSubContent(p ContextMenuSubContentProps) gx.Node
func ContextMenuSubContentWrap ¶
ContextMenuSubContentWrap renders the content behind its trigger inside a menu, as a page uses it.
func ContextMenuSubTrigger ¶
func ContextMenuSubTrigger(p ContextMenuSubTriggerProps) gx.Node
func ContextMenuSubTriggerWrap ¶
ContextMenuSubTriggerWrap renders the trigger inside a menu, as a page uses it.
func ContextMenuSubWrap ¶
ContextMenuSubWrap renders the sub-menu inside a menu, as a page uses it.
func ContextMenuTrigger ¶
func ContextMenuTrigger(p ContextMenuTriggerProps) gx.Node
Types ¶
type ContextMenuCheckboxItemProps ¶
type ContextMenuCheckboxItemProps struct {
// Name is the name attribute of the checkbox input. A form or a signal reads it.
Name string
// Value is the value that the form sends when the item is checked.
Value string
// Checked sets the item as checked on the first render.
Checked bool
// Disabled turns the item off. The arrow keys pass it.
Disabled bool
// Class adds classes to the root element.
Class string
// Children is the label of the item.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuGroupProps ¶
type ContextMenuItemProps ¶
type ContextMenuItemProps struct {
// Variant sets the visual style: Default or Destructive.
Variant Variant
// Inset adds left padding, so the item lines up with the checkbox and radio items.
Inset bool
// Disabled turns the item off. The arrow keys pass it.
Disabled bool
// Class adds classes to the root element.
Class string
// Children is the content of the item.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuLabelProps ¶
type ContextMenuLabelProps struct {
// Inset adds left padding, so the label lines up with the checkbox and radio items.
Inset bool
// Class adds classes to the root element.
Class string
// Children is the text of the label.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuLinkProps ¶
type ContextMenuProps ¶
type ContextMenuRadioGroupProps ¶
type ContextMenuRadioGroupProps struct {
// Label is the accessible name of the group. It is not visible.
Label string
// Class adds classes to the root element.
Class string
// Children is the radio items of the group.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuRadioItemProps ¶
type ContextMenuRadioItemProps struct {
// Name is the name attribute of the radio input. The radio items of one group share
// the same name.
Name string
// Value is the value that the form sends when the item is checked.
Value string
// Checked sets the item as checked on the first render.
Checked bool
// Disabled turns the item off. The arrow keys pass it.
Disabled bool
// Class adds classes to the root element.
Class string
// Children is the label of the item.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuSubProps ¶
type ContextMenuSubTriggerProps ¶
type ContextMenuSubTriggerProps struct {
// Inset adds left padding, so the trigger lines up with the checkbox and radio items.
Inset bool
// Disabled turns the trigger off. The arrow keys pass it.
Disabled bool
// Class adds classes to the root element.
Class string
// Children is the label of the trigger. A chevron follows it.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ContextMenuTriggerProps ¶
type ContextMenuTriggerProps struct {
// Id is the id of the menu that a right click on the trigger opens.
Id string
// Class adds classes to the root element. The trigger has no style of its own.
Class string
// Children is the content of the area that takes the right click.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
Source Files
¶
- ContextMenu.fixtures.go
- ContextMenuCheckboxItem.fixtures.go
- ContextMenuCheckboxItem_gx.go
- ContextMenuGroup.fixtures.go
- ContextMenuGroup_gx.go
- ContextMenuItem.fixtures.go
- ContextMenuItem_gx.go
- ContextMenuLabel.fixtures.go
- ContextMenuLabel_gx.go
- ContextMenuLink.fixtures.go
- ContextMenuLink_gx.go
- ContextMenuRadioGroup.fixtures.go
- ContextMenuRadioGroup_gx.go
- ContextMenuRadioItem.fixtures.go
- ContextMenuRadioItem_gx.go
- ContextMenuSeparator.fixtures.go
- ContextMenuSeparator_gx.go
- ContextMenuShortcut.fixtures.go
- ContextMenuShortcut_gx.go
- ContextMenuSub.fixtures.go
- ContextMenuSubContent.fixtures.go
- ContextMenuSubContent_gx.go
- ContextMenuSubTrigger.fixtures.go
- ContextMenuSubTrigger_gx.go
- ContextMenuSub_gx.go
- ContextMenuTrigger.fixtures.go
- ContextMenuTrigger_gx.go
- ContextMenu_gx.go
- styles.go