diff options
author | Markus Wüstenberg | 2020-12-22 10:53:22 +0100 |
---|---|---|
committer | GitHub | 2020-12-22 10:53:22 +0100 |
commit | f22ce3fb68ca6702a683b7759410ae50a9fddabd (patch) | |
tree | aace6553bb5c48b99d7205fe56d6b7d630b7799a /components | |
parent | 428a2519eaa8e16767f86b417abd5af007f24fc6 (diff) | |
download | gomponents-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.go | 10 |
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)) +} |