Low-level constructor. Named arguments become attributes; unnamed arguments become children (text or nested nodes).
Usage
tag(tag_name, ..., tag_type = c("normal", "void"))Examples
# web component
tag(tag_name = "calcite-action-bar", layout = "horizontal")
#> <calcite-action-bar layout="horizontal"></calcite-action-bar>
# custom element with children
tag(
tag_name = "my-card",
class = "shadow",
tag(tag_name = "my-card-header", "Title"),
tag(tag_name = "my-card-body", "Content")
)
#> <my-card class="shadow"><my-card-header>Title</my-card-header><my-card-body>Content</my-card-body></my-card>
# custom void element
tag(tag_name = "my-icon", name = "home", tag_type = "void")
#> <my-icon name="home" />