Documentation
¶
Index ¶
- Variables
- func Select(p SelectProps) gx.Node
- func SelectGroup(p SelectGroupProps) gx.Node
- func SelectGroupWrap(n gx.Node) gx.Node
- func SelectOption(p SelectOptionProps) gx.Node
- func SelectOptionWrap(n gx.Node) gx.Node
- func SelectSeparator(p SelectSeparatorProps) gx.Node
- func SelectSeparatorWrap(n gx.Node) gx.Node
- type SelectGroupProps
- type SelectOptionProps
- type SelectProps
- type SelectSeparatorProps
- type Size
Constants ¶
This section is empty.
Variables ¶
View Source
var SelectFixtures = gx.Fixtures[SelectProps]{ "Plan": {Name: "plan", Label: "Plan", Class: "w-48", Children: plans()}, "Small": {Name: "plan", Label: "Plan", Size: Sm, Class: "w-48", Children: plans()}, "Fit": {Name: "plan", Label: "Plan", Children: plans()}, "Disabled": {Name: "plan", Label: "Plan", Class: "w-48", Attrs: gx.Attrs{gx.Bool("disabled", true)}, Children: SelectOption(SelectOptionProps{Value: "free", Children: gx.Text("Free")})}, "Invalid": {Name: "plan", Label: "Plan", Class: "w-48", Attrs: gx.Attrs{{Key: "aria-invalid", Value: "true"}}, Children: plans()}, "Placeholder": {Name: "fruit", Label: "Fruit", Placeholder: "Select a fruit", Class: "w-48", Children: gx.Frag( SelectGroup(SelectGroupProps{Label: "Fruits", Children: gx.Frag( SelectOption(SelectOptionProps{Value: "apple", Children: gx.Text("Apple")}), SelectOption(SelectOptionProps{Value: "banana", Children: gx.Text("Banana")}), )}), SelectSeparator(SelectSeparatorProps{}), SelectGroup(SelectGroupProps{Label: "Vegetables", Children: gx.Frag( SelectOption(SelectOptionProps{Value: "carrot", Children: gx.Text("Carrot")}), SelectOption(SelectOptionProps{Value: "leek", Disabled: true, Children: gx.Text("Leek")}), )}), )}, }
View Source
var SelectGroupFixtures = gx.Fixtures[SelectGroupProps]{ "Group": {Label: "Fruits", Children: gx.Frag( SelectOption(SelectOptionProps{Value: "apple", Children: gx.Text("Apple")}), SelectOption(SelectOptionProps{Value: "banana", Children: gx.Text("Banana")}), )}, }
View Source
var SelectOptionFixtures = gx.Fixtures[SelectOptionProps]{"Option": {Value: "free", Children: gx.Text("Free")}}
View Source
var SelectSeparatorFixtures = gx.Fixtures[SelectSeparatorProps]{"Default": {}}
Functions ¶
func Select ¶
func Select(p SelectProps) gx.Node
func SelectGroup ¶
func SelectGroup(p SelectGroupProps) gx.Node
func SelectGroupWrap ¶
SelectGroupWrap renders the group inside a select, as a page uses it.
func SelectOption ¶
func SelectOption(p SelectOptionProps) gx.Node
func SelectOptionWrap ¶
SelectOptionWrap renders the option inside a select, as a page uses it.
func SelectSeparator ¶
func SelectSeparator(p SelectSeparatorProps) gx.Node
Types ¶
type SelectGroupProps ¶
type SelectOptionProps ¶
type SelectProps ¶
type SelectProps struct {
// Name is the form field name.
Name string
// Label is the accessible name of the select.
Label string
// Size sets the height: Md or Sm.
Size Size
// Placeholder is the text of a disabled first option that shows while no value is selected. An
// empty value renders no placeholder option.
Placeholder string
// Class adds classes to the root element.
Class string
// Children is the options of the select.
Children gx.Node
// Attrs adds HTML attributes to the select element.
Attrs gx.Attrs
}
type SelectSeparatorProps ¶
Click to show internal directories.
Click to hide internal directories.