input

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 1 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

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
}

Jump to

Keyboard shortcuts

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