diff options
author | Ken Powers | 2024-10-25 14:34:35 -0400 |
---|---|---|
committer | GitHub | 2024-10-25 20:34:35 +0200 |
commit | 2e44d495769421423921bfcb06ebfc53f8370dd3 (patch) | |
tree | 73915bb9e056d23f326b740e0ac61fbee3dc9177 /html/attributes.go | |
parent | 87bb2f37cb56ea53aafb06d5e264935a49e65bd6 (diff) | |
download | gomponents-2e44d495769421423921bfcb06ebfc53f8370dd3.tar.lz gomponents-2e44d495769421423921bfcb06ebfc53f8370dd3.tar.zst gomponents-2e44d495769421423921bfcb06ebfc53f8370dd3.zip |
Add web component elements and slot attribute (#235)
The slot attribute is a standard attribute for use with web components: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots
Diffstat (limited to 'html/attributes.go')
-rw-r--r-- | html/attributes.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index 2e9a05a..be8393e 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -133,6 +133,10 @@ func DataAttr(name, v string) g.Node { return Data(name, v) } +func SlotAttr(v string) g.Node { + return g.Attr("slot", v) +} + func For(v string) g.Node { return g.Attr("for", v) } |