Tags structure
A shiny tag is defined by:
- name:
- Such as
span
,div
, etc. - Accesed via
tag$name
.
- Such as
- attributes:
- Accesed via
tag$attributes
.
- Accesed via
- children:
- Accesed via
tag$children
.
- Accesed via
- R class:
- Namely
shiny.tag
.
- Namely
- name:
Example:
myTag <- div( class = "divClass", id = "first", h1("First child"), span( class = "child", id = "baby", "Crying" ) ) myTag
<div class="divClass" id="first"> <h1>First child</h1> <span class="child" id="baby">Crying</span> </div>
List of 3 $ name : chr "div" $ attribs :List of 2 ..$ class: chr "divClass" ..$ id : chr "first" $ children:List of 2 ..$ :List of 3 .. ..$ name : chr "h1" .. ..$ attribs : Named list() .. ..$ children:List of 1 .. .. ..$ : chr "First child" .. ..- attr(*, "class")= chr "shiny.tag" ..$ :List of 3 .. ..$ name : chr "span" .. ..$ attribs :List of 2 .. .. ..$ class: chr "child" .. .. ..$ id : chr "baby" .. ..$ children:List of 1 .. .. ..$ : chr "Crying" .. ..- attr(*, "class")= chr "shiny.tag" - attr(*, "class")= chr "shiny.tag"
[1] "div"
$class [1] "divClass" $id [1] "first"
[[1]] <h1>First child</h1> [[2]] <span class="child" id="baby">Crying</span>
<div class="divClass" id="first"> <h1>First child</h1> <span class="adult" id="baby">Crying</span> </div>