Documentation
¶
Index ¶
- Variables
- func DropdownMenu(p DropdownMenuProps) gx.Node
- func DropdownMenuCheckboxItem(p DropdownMenuCheckboxItemProps) gx.Node
- func DropdownMenuCheckboxItemWrap(n gx.Node) gx.Node
- func DropdownMenuGroup(p DropdownMenuGroupProps) gx.Node
- func DropdownMenuGroupWrap(n gx.Node) gx.Node
- func DropdownMenuItem(p DropdownMenuItemProps) gx.Node
- func DropdownMenuItemWrap(n gx.Node) gx.Node
- func DropdownMenuLabel(p DropdownMenuLabelProps) gx.Node
- func DropdownMenuLink(p DropdownMenuLinkProps) gx.Node
- func DropdownMenuLinkWrap(n gx.Node) gx.Node
- func DropdownMenuRadioGroup(p DropdownMenuRadioGroupProps) gx.Node
- func DropdownMenuRadioGroupWrap(n gx.Node) gx.Node
- func DropdownMenuRadioItem(p DropdownMenuRadioItemProps) gx.Node
- func DropdownMenuRadioItemWrap(n gx.Node) gx.Node
- func DropdownMenuSeparator(p DropdownMenuSeparatorProps) gx.Node
- func DropdownMenuShortcut(p DropdownMenuShortcutProps) gx.Node
- func DropdownMenuSub(p DropdownMenuSubProps) gx.Node
- func DropdownMenuSubContent(p DropdownMenuSubContentProps) gx.Node
- func DropdownMenuSubContentWrap(n gx.Node) gx.Node
- func DropdownMenuSubTrigger(p DropdownMenuSubTriggerProps) gx.Node
- func DropdownMenuSubTriggerWrap(n gx.Node) gx.Node
- func DropdownMenuSubWrap(n gx.Node) gx.Node
- func DropdownMenuTrigger(p DropdownMenuTriggerProps) gx.Node
- type Align
- type DropdownMenuCheckboxItemProps
- type DropdownMenuGroupProps
- type DropdownMenuItemProps
- type DropdownMenuLabelProps
- type DropdownMenuLinkProps
- type DropdownMenuProps
- type DropdownMenuRadioGroupProps
- type DropdownMenuRadioItemProps
- type DropdownMenuSeparatorProps
- type DropdownMenuShortcutProps
- type DropdownMenuSubContentProps
- type DropdownMenuSubProps
- type DropdownMenuSubTriggerProps
- type DropdownMenuTriggerProps
- type Variant
Constants ¶
This section is empty.
Variables ¶
var DropdownMenuCheckboxItemFixtures = gx.Fixtures[DropdownMenuCheckboxItemProps]{ "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 DropdownMenuFixtures = gx.Fixtures[DropdownMenuProps]{ "Menu": {Id: "demo-dropdown", Class: "w-56", Children: gx.Frag( DropdownMenuLabel(DropdownMenuLabelProps{Children: gx.Text("My account")}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuGroup(DropdownMenuGroupProps{Label: "Account", Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Profile")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Frag( gx.Text("Settings"), DropdownMenuShortcut(DropdownMenuShortcutProps{Children: gx.Text("⌘S")}), )}), DropdownMenuLink(DropdownMenuLinkProps{Href: gx.URL("/docs"), Children: gx.Text("Documentation")}), )}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuCheckboxItem(DropdownMenuCheckboxItemProps{Name: "status-bar", Checked: true, Children: gx.Text("Status bar")}), DropdownMenuCheckboxItem(DropdownMenuCheckboxItemProps{Name: "panel", Children: gx.Text("Panel")}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuRadioGroup(DropdownMenuRadioGroupProps{Label: "Position", Children: gx.Frag( DropdownMenuRadioItem(DropdownMenuRadioItemProps{Name: "demo-dropdown-position", Value: "top", Checked: true, Children: gx.Text("Top")}), DropdownMenuRadioItem(DropdownMenuRadioItemProps{Name: "demo-dropdown-position", Value: "bottom", Children: gx.Text("Bottom")}), )}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuItem(DropdownMenuItemProps{Variant: Destructive, Children: gx.Text("Sign out")}), )}, "End": {Id: "demo-dropdown-end", Align: End, Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Rename")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Duplicate")}), DropdownMenuItem(DropdownMenuItemProps{Disabled: true, Children: gx.Text("Archive")}), DropdownMenuItem(DropdownMenuItemProps{Variant: Destructive, Children: gx.Text("Delete")}), )}, "Start": {Id: "demo-dropdown-start", Align: Start, Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Rename")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Duplicate")}), )}, "Sub": {Id: "demo-dropdown-sub", Class: "w-56", Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("New tab")}), DropdownMenuSub(DropdownMenuSubProps{Children: gx.Frag( DropdownMenuSubTrigger(DropdownMenuSubTriggerProps{Children: gx.Text("More tools")}), DropdownMenuSubContent(DropdownMenuSubContentProps{Class: "w-48", Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Save page")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Create shortcut")}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Developer tools")}), )}), )}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Print")}), )}, }
var DropdownMenuGroupFixtures = gx.Fixtures[DropdownMenuGroupProps]{ "Default": {Label: "Account", Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Profile")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Billing")}), )}, }
var DropdownMenuItemFixtures = gx.Fixtures[DropdownMenuItemProps]{ "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 DropdownMenuLabelFixtures = gx.Fixtures[DropdownMenuLabelProps]{ "Label": {Children: gx.Text("My account")}, "Inset": {Inset: true, Children: gx.Text("My account")}, }
var DropdownMenuLinkFixtures = gx.Fixtures[DropdownMenuLinkProps]{"Link": {Href: gx.URL("/docs"), Children: gx.Text("Documentation")}}
var DropdownMenuRadioGroupFixtures = gx.Fixtures[DropdownMenuRadioGroupProps]{ "Default": {Label: "Position", Children: gx.Frag( DropdownMenuRadioItem(DropdownMenuRadioItemProps{Name: "dropdown-menu-group-position", Value: "top", Checked: true, Children: gx.Text("Top")}), DropdownMenuRadioItem(DropdownMenuRadioItemProps{Name: "dropdown-menu-group-position", Value: "bottom", Children: gx.Text("Bottom")}), )}, }
var DropdownMenuRadioItemFixtures = gx.Fixtures[DropdownMenuRadioItemProps]{ "Checked": {Name: "dropdown-menu-item-checked", Value: "top", Checked: true, Children: gx.Text("Top")}, "Unchecked": {Name: "dropdown-menu-item-unchecked", Value: "bottom", Children: gx.Text("Bottom")}, }
var DropdownMenuSeparatorFixtures = gx.Fixtures[DropdownMenuSeparatorProps]{"Default": {}}
var DropdownMenuShortcutFixtures = gx.Fixtures[DropdownMenuShortcutProps]{"Default": {Children: gx.Text("⌘K")}}
var DropdownMenuSubContentFixtures = gx.Fixtures[DropdownMenuSubContentProps]{ "Content": {Class: "w-48", Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Save page")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Create shortcut")}), DropdownMenuSeparator(DropdownMenuSeparatorProps{}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Developer tools")}), )}, }
var DropdownMenuSubFixtures = gx.Fixtures[DropdownMenuSubProps]{ "Default": {Children: gx.Frag( DropdownMenuSubTrigger(DropdownMenuSubTriggerProps{Children: gx.Text("More tools")}), DropdownMenuSubContent(DropdownMenuSubContentProps{Children: gx.Frag( DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Save page")}), DropdownMenuItem(DropdownMenuItemProps{Children: gx.Text("Create shortcut")}), )}), )}, }
var DropdownMenuSubTriggerFixtures = gx.Fixtures[DropdownMenuSubTriggerProps]{ "Trigger": {Children: gx.Text("More tools")}, "Inset": {Inset: true, Children: gx.Text("More tools")}, "Disabled": {Disabled: true, Children: gx.Text("More tools")}, }
var DropdownMenuTriggerFixtures = gx.Fixtures[DropdownMenuTriggerProps]{ "Default": {Id: "demo-dropdown", Children: gx.Text("Open menu")}, "Ghost": {Id: "demo-dropdown-end", Variant: button.Ghost, Size: button.Sm, Class: "ml-32", Children: gx.Text("Open at the end")}, "Start": {Id: "demo-dropdown-start", Variant: button.Secondary, Children: gx.Text("Open at the start")}, "Sub": {Id: "demo-dropdown-sub", Children: gx.Text("Open with a sub-menu")}, }
Functions ¶
func DropdownMenu ¶
func DropdownMenu(p DropdownMenuProps) gx.Node
func DropdownMenuCheckboxItem ¶
func DropdownMenuCheckboxItem(p DropdownMenuCheckboxItemProps) gx.Node
func DropdownMenuCheckboxItemWrap ¶
DropdownMenuCheckboxItemWrap renders the item inside a menu, as a page uses it.
func DropdownMenuGroup ¶
func DropdownMenuGroup(p DropdownMenuGroupProps) gx.Node
func DropdownMenuGroupWrap ¶
DropdownMenuGroupWrap renders the group inside a menu, as a page uses it.
func DropdownMenuItem ¶
func DropdownMenuItem(p DropdownMenuItemProps) gx.Node
func DropdownMenuItemWrap ¶
DropdownMenuItemWrap renders the item inside a menu, as a page uses it.
func DropdownMenuLabel ¶
func DropdownMenuLabel(p DropdownMenuLabelProps) gx.Node
func DropdownMenuLink ¶
func DropdownMenuLink(p DropdownMenuLinkProps) gx.Node
func DropdownMenuLinkWrap ¶
DropdownMenuLinkWrap renders the item inside a menu, as a page uses it.
func DropdownMenuRadioGroup ¶
func DropdownMenuRadioGroup(p DropdownMenuRadioGroupProps) gx.Node
func DropdownMenuRadioGroupWrap ¶
DropdownMenuRadioGroupWrap renders the group inside a menu, as a page uses it.
func DropdownMenuRadioItem ¶
func DropdownMenuRadioItem(p DropdownMenuRadioItemProps) gx.Node
func DropdownMenuRadioItemWrap ¶
DropdownMenuRadioItemWrap renders the item inside a menu, as a page uses it.
func DropdownMenuSeparator ¶
func DropdownMenuSeparator(p DropdownMenuSeparatorProps) gx.Node
func DropdownMenuShortcut ¶
func DropdownMenuShortcut(p DropdownMenuShortcutProps) gx.Node
func DropdownMenuSub ¶
func DropdownMenuSub(p DropdownMenuSubProps) gx.Node
func DropdownMenuSubContent ¶
func DropdownMenuSubContent(p DropdownMenuSubContentProps) gx.Node
func DropdownMenuSubContentWrap ¶
DropdownMenuSubContentWrap renders the content behind its trigger inside a menu, as a page uses it.
func DropdownMenuSubTrigger ¶
func DropdownMenuSubTrigger(p DropdownMenuSubTriggerProps) gx.Node
func DropdownMenuSubTriggerWrap ¶
DropdownMenuSubTriggerWrap renders the trigger inside a menu, as a page uses it.
func DropdownMenuSubWrap ¶
DropdownMenuSubWrap renders the sub-menu inside a menu, as a page uses it.
func DropdownMenuTrigger ¶
func DropdownMenuTrigger(p DropdownMenuTriggerProps) gx.Node
Types ¶
type DropdownMenuCheckboxItemProps ¶
type DropdownMenuCheckboxItemProps 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 DropdownMenuGroupProps ¶
type DropdownMenuItemProps ¶
type DropdownMenuItemProps 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 DropdownMenuLabelProps ¶
type DropdownMenuLabelProps 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 DropdownMenuLinkProps ¶
type DropdownMenuProps ¶
type DropdownMenuProps struct {
// Id is the id of the root element. The trigger opens the menu by this id.
Id string
// Align sets the edge of the trigger that the menu lines up with: Center, Start or End.
Align Align
// Class adds classes to the root element.
Class string
// Children is the menu items.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type DropdownMenuRadioGroupProps ¶
type DropdownMenuRadioGroupProps 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 DropdownMenuRadioItemProps ¶
type DropdownMenuRadioItemProps 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 DropdownMenuSubProps ¶
type DropdownMenuSubTriggerProps ¶
type DropdownMenuSubTriggerProps 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 DropdownMenuTriggerProps ¶
type DropdownMenuTriggerProps struct {
// Id is the id of the menu that the trigger opens.
Id string
// Variant sets the visual style of the button: button.Default, button.Secondary,
// button.Destructive, button.Outline, button.Ghost or button.Link.
Variant button.Variant
// Size sets the height and padding of the button: button.Xs, button.Sm, button.Md, button.Lg,
// or an Icon size for a square button.
Size button.Size
// Class adds classes to the root element.
Class string
// Children is the button label.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
Source Files
¶
- DropdownMenu.fixtures.go
- DropdownMenuCheckboxItem.fixtures.go
- DropdownMenuCheckboxItem_gx.go
- DropdownMenuGroup.fixtures.go
- DropdownMenuGroup_gx.go
- DropdownMenuItem.fixtures.go
- DropdownMenuItem_gx.go
- DropdownMenuLabel.fixtures.go
- DropdownMenuLabel_gx.go
- DropdownMenuLink.fixtures.go
- DropdownMenuLink_gx.go
- DropdownMenuRadioGroup.fixtures.go
- DropdownMenuRadioGroup_gx.go
- DropdownMenuRadioItem.fixtures.go
- DropdownMenuRadioItem_gx.go
- DropdownMenuSeparator.fixtures.go
- DropdownMenuSeparator_gx.go
- DropdownMenuShortcut.fixtures.go
- DropdownMenuShortcut_gx.go
- DropdownMenuSub.fixtures.go
- DropdownMenuSubContent.fixtures.go
- DropdownMenuSubContent_gx.go
- DropdownMenuSubTrigger.fixtures.go
- DropdownMenuSubTrigger_gx.go
- DropdownMenuSub_gx.go
- DropdownMenuTrigger.fixtures.go
- DropdownMenuTrigger_gx.go
- DropdownMenu_gx.go
- styles.go