about summary refs log tree commit diff stats
path: root/attr/boolean.go
diff options
context:
space:
mode:
authorMarkus Wüstenberg2020-10-28 16:59:04 +0100
committerGitHub2020-10-28 16:59:04 +0100
commit13701c4f668eba27956a8ac554a1fe272245d210 (patch)
treeb123bbbedaa1fe8f666ce3981fead6e884dd0b74 /attr/boolean.go
parent18e90339fcac48806a5777766aeb256be2b8c4bc (diff)
downloadgomponents-13701c4f668eba27956a8ac554a1fe272245d210.tar.lz
gomponents-13701c4f668eba27956a8ac554a1fe272245d210.tar.zst
gomponents-13701c4f668eba27956a8ac554a1fe272245d210.zip
Add attribute helpers (#35)
Also refactor tests to be table-driven, for readability.
Diffstat (limited to 'attr/boolean.go')
-rw-r--r--attr/boolean.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/attr/boolean.go b/attr/boolean.go
new file mode 100644
index 0000000..2a70c9d
--- /dev/null
+++ b/attr/boolean.go
@@ -0,0 +1,45 @@
+package attr
+
+import (
+	g "github.com/maragudk/gomponents"
+)
+
+func Async() g.Node {
+	return g.Attr("async")
+}
+
+func AutoFocus() g.Node {
+	return g.Attr("autofocus")
+}
+
+func AutoPlay() g.Node {
+	return g.Attr("autoplay")
+}
+
+func Controls() g.Node {
+	return g.Attr("controls")
+}
+
+func Defer() g.Node {
+	return g.Attr("defer")
+}
+
+func Disabled() g.Node {
+	return g.Attr("disabled")
+}
+
+func Multiple() g.Node {
+	return g.Attr("multiple")
+}
+
+func ReadOnly() g.Node {
+	return g.Attr("readonly")
+}
+
+func Required() g.Node {
+	return g.Attr("required")
+}
+
+func Selected() g.Node {
+	return g.Attr("selected")
+}