Add convenience helpers for form elements (#19)
1 file changed, 15 insertions(+), 0 deletions(-)
changed files
A attr/forms.go
@@ -0,0 +1,15 @@ +package attr + +import ( + g "github.com/maragudk/gomponents" +) + +// Placeholder returns an attribute with name "placeholder" and the given value. +func Placeholder(v string) g.Node { + return g.Attr("placeholder", v) +} + +// Required returns an attribute with name "required". +func Required() g.Node { + return g.Attr("required") +}