% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tags.R
\name{tag}
\alias{tag}
\title{Create an HTML element node}
\usage{
tag(tag_name, ..., tag_type = c("normal", "void"))
}
\arguments{
\item{tag_name}{String /// Required.
The HTML element name.}

\item{...}{Attributes (named) and children (unnamed) /// Optional.}

\item{tag_type}{String /// Optional.
Either \code{"normal"} (default) for a standard
element with children, or \code{"void"} for a self-closing element
whose children are ignored.}
}
\value{
List of class \code{"hypertext.tag"} with components \code{tag}, \code{attrs},
\code{children}, and \code{tag_type}.
}
\description{
Low-level constructor. Named arguments become attributes; unnamed
arguments become children (text or nested nodes).
}
\examples{
# web component
tag(tag_name = "calcite-action-bar", layout = "horizontal")

# 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")
)

# custom void element
tag(tag_name = "my-icon", name = "home", tag_type = "void")
}
