Documentation
¶
Index ¶
- Variables
- func ButtonGroup(p ButtonGroupProps) gx.Node
- func ButtonGroupSeparator(p ButtonGroupSeparatorProps) gx.Node
- func ButtonGroupSeparatorWrap(n gx.Node) gx.Node
- func ButtonGroupText(p ButtonGroupTextProps) gx.Node
- type ButtonGroupProps
- type ButtonGroupSeparatorProps
- type ButtonGroupTextProps
- type Orientation
Constants ¶
This section is empty.
Variables ¶
View Source
var ButtonGroupFixtures = gx.Fixtures[ButtonGroupProps]{ "Three": {Children: gx.Frag( button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("One")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Two")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Three")}), )}, "Vertical": {Orientation: Vertical, Children: gx.Frag( button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("One")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Two")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Three")}), )}, "Separator": {Children: gx.Frag( button.Button(button.ButtonProps{Variant: button.Secondary, Children: gx.Text("Copy")}), ButtonGroupSeparator(ButtonGroupSeparatorProps{}), button.Button(button.ButtonProps{Variant: button.Secondary, Size: button.Icon, Attrs: gx.Attrs{{Key: "aria-label", Value: "More"}}, Children: icons.ChevronDown(icons.ChevronDownProps{})}), )}, "Text": {Children: gx.Frag( ButtonGroupText(ButtonGroupTextProps{Children: gx.Text("https://")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("example.com")}), )}, "Nested": {Children: gx.Frag( ButtonGroup(ButtonGroupProps{Children: gx.Frag( button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("One")}), button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Two")}), )}), ButtonGroup(ButtonGroupProps{Children: button.Button(button.ButtonProps{Variant: button.Outline, Children: gx.Text("Three")})}), )}, }
View Source
var ButtonGroupSeparatorFixtures = gx.Fixtures[ButtonGroupSeparatorProps]{"Default": {}}
View Source
var ButtonGroupTextFixtures = gx.Fixtures[ButtonGroupTextProps]{"Text": {Children: gx.Text("https://")}}
Functions ¶
func ButtonGroup ¶
func ButtonGroup(p ButtonGroupProps) gx.Node
func ButtonGroupSeparator ¶
func ButtonGroupSeparator(p ButtonGroupSeparatorProps) gx.Node
func ButtonGroupSeparatorWrap ¶
ButtonGroupSeparatorWrap renders the separator between two buttons, as a group uses it.
func ButtonGroupText ¶
func ButtonGroupText(p ButtonGroupTextProps) gx.Node
Types ¶
type ButtonGroupProps ¶
type ButtonGroupProps struct {
// Orientation sets the direction of the group: Horizontal for a row or Vertical for a column.
Orientation Orientation
// Children is the content of the group: the buttons, inputs, separators and text.
Children gx.Node
// Class adds classes to the root element.
Class string
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ButtonGroupSeparatorProps ¶
type ButtonGroupSeparatorProps struct {
// Orientation sets the direction of the line: Vertical or Horizontal. Use Vertical in a
// horizontal group.
Orientation Orientation
// Class adds classes to the root element.
Class string
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ButtonGroupTextProps ¶
type ButtonGroupTextProps struct {
// For is the id of an input. A non-empty value renders the text as the label of that input.
For string
// Class adds classes to the root element.
Class string
// Children is the content of the text block.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type Orientation ¶
type Orientation string
Orientation is the direction of a button group or of its separator.
const ( Horizontal Orientation = "horizontal" Vertical Orientation = "vertical" )
The orientations of buttongroup.ButtonGroup and buttongroup.ButtonGroupSeparator.
Click to show internal directories.
Click to hide internal directories.