attr

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package attr provides shortcuts and helpers to common HTML attributes. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes for a list of attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Class

func Class(v string) g.Node

Class returns an attribute with name "class" and the given value.

func ID

func ID(v string) g.Node

ID returns an attribute with name "id" and the given value.

func Placeholder added in v0.5.0

func Placeholder(v string) g.Node

Placeholder returns an attribute with name "placeholder" and the given value.

func Required added in v0.5.0

func Required() g.Node

Required returns an attribute with name "required".

Types

type Classes

type Classes map[string]bool

Classes is a map of strings to booleans, which Renders to an attribute with name "class". The attribute value is a sorted, space-separated string of all the map keys, for which the corresponding map value is true.

func (Classes) Place added in v0.5.0

func (c Classes) Place() g.Placement

func (Classes) Render added in v0.4.0

func (c Classes) Render() string

func (Classes) String added in v0.4.0

func (c Classes) String() string

String satisfies fmt.Stringer.

Jump to

Keyboard shortcuts

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