dropdown

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<select")
	TagClose = []byte("</select>")

	AttrName         = []byte(" name=\"")
	AttrAutoComplete = []byte(" autocomplete=\"")
	AttrDisabled     = []byte(" disabled")
	AttrForm         = []byte(" form=\"")
	AttrMultiple     = []byte(" multiple")
	AttrRequired     = []byte(" required")
	AttrSize         = []byte(" size=\"")
)

Byte constants for HTML rendering.

Functions

func New

func New(nodes ...node.Node) *element

New Creates a new select element with option and optgroup child elements. Example: dropdown.New(option.Option("Red", "red"), option.Option("Blue", "blue")) Renders: <select><option value="red">Red</option><option value="blue">Blue</option></select>

func Options added in v0.3.0

func Options(options ...*option.Element) *element

Options Creates a select element from option elements, enforcing correct nesting at compile time. Example: dropdown.Options(option.Option("red", "Red"), option.Option("blue", "Blue")) Renders: <select><option value="red">Red</option><option value="blue">Blue</option></select>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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