Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ToggleGroupFixtures = gx.Fixtures[ToggleGroupProps]{ "Three": {Label: "Alignment", Children: align("align")}, "Outline": {Label: "Alignment", Variant: Outline, Children: align("align-outline")}, "Spaced": {Label: "Alignment", Spacing: 2, Children: align("align-spaced")}, "OutlineSpaced": {Label: "Alignment", Variant: Outline, Spacing: 2, Children: align("align-outline-spaced")}, "Small": {Label: "Alignment", Variant: Outline, Size: Sm, Children: align("align-small")}, "Large": {Label: "Alignment", Variant: Outline, Size: Lg, Children: align("align-large")}, "Multiple": {Label: "Format", Variant: Outline, Children: gx.Frag( ToggleGroupItem(ToggleGroupItemProps{Name: "bold", Value: "on", Multiple: true, Checked: true, Children: gx.Text("Bold")}), ToggleGroupItem(ToggleGroupItemProps{Name: "italic", Value: "on", Multiple: true, Checked: true, Children: gx.Text("Italic")}), ToggleGroupItem(ToggleGroupItemProps{Name: "strike", Value: "on", Multiple: true, Disabled: true, Children: gx.Text("Strike")}), )}, }
View Source
var ToggleGroupItemFixtures = gx.Fixtures[ToggleGroupItemProps]{ "Checked": {Name: "align-demo", Value: "left", Checked: true, Children: gx.Text("Left")}, "Disabled": {Name: "align-disabled", Value: "left", Disabled: true, Children: gx.Text("Left")}, }
Functions ¶
func ToggleGroup ¶
func ToggleGroup(p ToggleGroupProps) gx.Node
func ToggleGroupItem ¶
func ToggleGroupItem(p ToggleGroupItemProps) gx.Node
Types ¶
type ToggleGroupItemProps ¶
type ToggleGroupItemProps struct {
// Name is the form field name. Every item of an exclusive group has the same name.
Name string
// Value is the value the form submits when the item is checked.
Value string
// Checked selects the item for the first render.
Checked bool
// Multiple renders a checkbox in place of a radio, so the item toggles on its own.
Multiple bool
// Disabled disables the item.
Disabled bool
// Class adds classes to the root element.
Class string
// Children is the item label.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
type ToggleGroupProps ¶
type ToggleGroupProps struct {
// Variant sets the visual style of every item: Default or Outline.
Variant Variant
// Size sets the height of every item: Sm, Md or Lg.
Size Size
// Spacing is the gap between the items in spacing units. Zero joins the items.
Spacing int
// Label is the accessible name of the group.
Label string
// Class adds classes to the root element.
Class string
// Children is the toggle items.
Children gx.Node
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
Click to show internal directories.
Click to hide internal directories.