shiny.ui.TagList#

class shiny.ui.TagList(*args)#

Create an HTML tag list (i.e., a fragment of HTML)

Parameters

*args – The tag children to add to the list.

Example

>>> from htmltools import TagList, div
>>> TagList("hello", div(id="foo", class_="bar"))
hello
<div id="foo" class="bar"></div>

Methods

append(*args)

Append tag children to the end of the list.

clear()

Remove all items from list.

copy()

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(x)

Extend the children by appending an iterable of children.

get_dependencies(*[, dedup])

Get any dependencies needed to render the HTML.

get_html_string([indent, eol, _escape_strings])

Return the HTML string for this tag list.

index(value[, start, stop])

Return first index of value.

insert(index, x)

Insert tag children before a given index.

pop([index])

Remove and return item at index (default last).

remove(value, /)

Remove first occurrence of value.

render()

Get string representation as well as it's HTML dependencies.

reverse()

Reverse IN PLACE.

save_html(file, *[, libdir, include_version])

Save to a HTML file.

show([renderer])

Preview as a complete HTML document.

sort(*[, key, reverse])

Sort the list in ascending order and return None.

tagify()

Convert any tagifiable children to Tag/TagList objects.