about summary refs log tree commit diff stats
path: root/components
diff options
context:
space:
mode:
authorMarkus Wüstenberg2020-12-22 10:53:22 +0100
committerGitHub2020-12-22 10:53:22 +0100
commitf22ce3fb68ca6702a683b7759410ae50a9fddabd (patch)
treeaace6553bb5c48b99d7205fe56d6b7d630b7799a /components
parent428a2519eaa8e16767f86b417abd5af007f24fc6 (diff)
downloadgomponents-f22ce3fb68ca6702a683b7759410ae50a9fddabd.tar.lz
gomponents-f22ce3fb68ca6702a683b7759410ae50a9fddabd.tar.zst
gomponents-f22ce3fb68ca6702a683b7759410ae50a9fddabd.zip
Add If helper function (#57)
Used to inline conditional nodes.
Diffstat (limited to 'components')
-rw-r--r--components/elements.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/elements.go b/components/elements.go
new file mode 100644
index 0000000..baffba6
--- /dev/null
+++ b/components/elements.go
@@ -0,0 +1,10 @@
+package components
+
+import (
+	g "github.com/maragudk/gomponents"
+	. "github.com/maragudk/gomponents/html"
+)
+
+func InputHidden(name, value string, children ...g.Node) g.NodeFunc {
+	return Input(Type("hidden"), Name(name), Value(value), g.Group(children))
+}