buttongroup

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func ButtonGroupSeparatorWrap(n gx.Node) gx.Node

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL