all repos — gomponents @ 5929ba8c41859ca9ea4117f42525e7be370ff55f

HTML components in pure Go

Add convenience helpers for form elements (#19)

Markus Wüstenberg
commit

5929ba8c41859ca9ea4117f42525e7be370ff55f

parent

4c109f9f1d4db4733d267ece171a533521029bdb

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") +}