Documentation
¶
Index ¶
Constants ¶
View Source
const Class = Control + " focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
Class is the classes of an input. A control that looks like an input takes these classes.
View Source
const Control = "" /* 545-byte string literal not displayed */
Control is the classes of an input without its focus ring. A group that draws the ring on its own border takes these classes for its control.
Variables ¶
View Source
var InputFixtures = gx.Fixtures[InputProps]{ "Text": {Placeholder: "Email"}, "Filled": {Value: "ada@example.com", Attrs: gx.Attrs{{Key: "aria-label", Value: "Email"}}}, "Disabled": {Attrs: gx.Attrs{gx.Bool("disabled", true)}, Placeholder: "Disabled"}, "Invalid": {Value: "ada@", Attrs: gx.Attrs{{Key: "aria-label", Value: "Email"}, {Key: "aria-invalid", Value: "true"}}}, "File": {Type: "file", Attrs: gx.Attrs{{Key: "aria-label", Value: "File"}}}, }
Functions ¶
func Input ¶
func Input(p InputProps) gx.Node
Types ¶
type InputProps ¶
type InputProps struct {
// Id is the id of the root element. A label points at it.
Id string
// Type is the type attribute. Empty means "text".
Type string
// Name is the name attribute. The form sends the value under this name.
Name string
// Value is the value attribute: the start value of the input.
Value string
// Placeholder is the placeholder attribute: the hint text of an empty control.
Placeholder string
// Class adds classes to the root element.
Class string
// Attrs adds HTML attributes to the root element.
Attrs gx.Attrs
}
Click to show internal directories.
Click to hide internal directories.