inputgroup

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 5 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 InputGroupAddonFixtures = gx.Fixtures[InputGroupAddonProps]{"Text": {Children: gx.Text("@")}}
View Source
var InputGroupButtonFixtures = gx.Fixtures[InputGroupButtonProps]{
	"ExtraSmall": {Children: gx.Text("Search")},
	"Small":      {Size: Sm, Children: gx.Text("Search")},
	"IconXs":     {Size: IconXs, Attrs: name("Clear"), Children: icons.X(icons.XProps{})},
	"IconSm":     {Size: IconSm, Attrs: name("Clear"), Children: icons.X(icons.XProps{})},
}
View Source
var InputGroupFixtures = gx.Fixtures[InputGroupProps]{
	"LeadingText": {Children: gx.Frag(
		InputGroupAddon(InputGroupAddonProps{Children: InputGroupText(InputGroupTextProps{Children: gx.Text("$")})}),
		InputGroupInput(InputGroupInputProps{Placeholder: "0.00", Attrs: name("Amount")}),
	)},
	"TrailingText": {Children: gx.Frag(
		InputGroupInput(InputGroupInputProps{Placeholder: "example", Attrs: name("Domain")}),
		InputGroupAddon(InputGroupAddonProps{Align: InlineEnd, Children: InputGroupText(InputGroupTextProps{Children: gx.Text(".com")})}),
	)},
	"Button": {Children: gx.Frag(
		InputGroupInput(InputGroupInputProps{Placeholder: "Search", Attrs: name("Search")}),
		InputGroupAddon(InputGroupAddonProps{Align: InlineEnd, Children: InputGroupButton(InputGroupButtonProps{Children: gx.Text("Search")})}),
	)},
	"IconButton": {Children: gx.Frag(
		InputGroupInput(InputGroupInputProps{Value: "ada@example.com", Attrs: name("Email")}),
		InputGroupAddon(InputGroupAddonProps{Align: InlineEnd, Children: InputGroupButton(InputGroupButtonProps{
			Size:     IconXs,
			Attrs:    name("Clear"),
			Children: icons.X(icons.XProps{}),
		})}),
	)},
	"Invalid": {Children: gx.Frag(
		InputGroupAddon(InputGroupAddonProps{Children: icons.Info(icons.InfoProps{})}),
		InputGroupInput(InputGroupInputProps{Value: "ada@", Attrs: gx.Attrs{{Key: "aria-label", Value: "Email"}, {Key: "aria-invalid", Value: "true"}}}),
	)},
	"Textarea": {Children: gx.Frag(
		InputGroupTextarea(InputGroupTextareaProps{Placeholder: "Ask a question.", Attrs: name("Question")}),
		InputGroupAddon(InputGroupAddonProps{Align: BlockEnd, Children: gx.Frag(
			InputGroupText(InputGroupTextProps{Children: gx.Text("120 characters left")}),
			InputGroupButton(InputGroupButtonProps{Variant: button.Default, Size: Sm, Class: "ml-auto", Children: gx.Text("Send")}),
		)}),
	)},
	"BlockStart": {Children: gx.Frag(
		InputGroupAddon(InputGroupAddonProps{Align: BlockStart, Children: InputGroupText(InputGroupTextProps{Children: gx.Text("Amount")})}),
		InputGroupInput(InputGroupInputProps{Placeholder: "0.00", Attrs: name("Amount")}),
	)},
}
View Source
var InputGroupInputFixtures = gx.Fixtures[InputGroupInputProps]{"Placeholder": {Placeholder: "Value", Attrs: name("Value")}}
View Source
var InputGroupTextFixtures = gx.Fixtures[InputGroupTextProps]{"Text": {Children: gx.Text("Text")}}
View Source
var InputGroupTextareaFixtures = gx.Fixtures[InputGroupTextareaProps]{
	"Placeholder": {Placeholder: "Ask a question.", Attrs: name("Question")},
}

Functions

func InputGroup

func InputGroup(p InputGroupProps) gx.Node

func InputGroupAddon

func InputGroupAddon(p InputGroupAddonProps) gx.Node

func InputGroupButton

func InputGroupButton(p InputGroupButtonProps) gx.Node

func InputGroupInput

func InputGroupInput(p InputGroupInputProps) gx.Node

func InputGroupInputWrap

func InputGroupInputWrap(n gx.Node) gx.Node

InputGroupInputWrap renders the input in a group, which draws its border and its focus ring.

func InputGroupText

func InputGroupText(p InputGroupTextProps) gx.Node

func InputGroupTextarea

func InputGroupTextarea(p InputGroupTextareaProps) gx.Node

func InputGroupTextareaWrap

func InputGroupTextareaWrap(n gx.Node) gx.Node

InputGroupTextareaWrap renders the textarea in a group, which draws its border and its focus ring.

Types

type Align

type Align string

Align is the position of an addon inside an input group.

const (
	InlineStart Align = "inline-start"
	InlineEnd   Align = "inline-end"
	BlockStart  Align = "block-start"
	BlockEnd    Align = "block-end"
)

The alignments of inputgroup.InputGroupAddon.

type InputGroupAddonProps

type InputGroupAddonProps struct {
	// Align sets the position of the addon: InlineStart, InlineEnd, BlockStart or BlockEnd.
	Align Align
	// Class adds classes to the root element.
	Class string
	// Children is the content of the addon, for example an icon, text or a button.
	Children gx.Node
	// Attrs adds HTML attributes to the root element.
	Attrs gx.Attrs
}

type InputGroupButtonProps

type InputGroupButtonProps struct {
	// Variant sets the visual style. It takes a button.Variant: Default, Secondary, Destructive,
	// Outline, Ghost or Link.
	Variant button.Variant
	// Size sets the height and padding: Xs, Sm, or IconXs or IconSm for a square button.
	Size Size
	// Type is the type attribute: "button", "submit" or "reset".
	Type string
	// Class adds classes to the root element.
	Class string
	// Children is the button label.
	Children gx.Node
	// Attrs adds HTML attributes to the root element.
	Attrs gx.Attrs
}

type InputGroupInputProps

type InputGroupInputProps 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
}

type InputGroupProps

type InputGroupProps struct {
	// Class adds classes to the root element.
	Class string
	// Children is the content of the group: one control and its addons.
	Children gx.Node
	// Attrs adds HTML attributes to the root element.
	Attrs gx.Attrs
}

type InputGroupTextProps

type InputGroupTextProps struct {
	// Class adds classes to the root element.
	Class string
	// Children is the content of the text, with or without an icon.
	Children gx.Node
	// Attrs adds HTML attributes to the root element.
	Attrs gx.Attrs
}

type InputGroupTextareaProps

type InputGroupTextareaProps struct {
	// Id is the id of the root element. A label points at it.
	Id string
	// Name is the name attribute. The form sends the value under this name.
	Name string
	// Value is the start text of the textarea.
	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
}

type Size

type Size string

Size is the height and padding of a button inside an input group.

const (
	Xs     Size = "xs"
	Sm     Size = "sm"
	IconXs Size = "icon-xs"
	IconSm Size = "icon-sm"
)

The sizes of inputgroup.InputGroupButton.

Jump to

Keyboard shortcuts

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