tagAssert: Check that a tag has specific properties

Description Usage Arguments Value Examples

View source: R/validation.R

Description

Check for type and class. Raise an error if the conditions are not fulfilled. This function is borrowed from shinydashboard.

Usage

1
tagAssert(tag, type = NULL, class = NULL, allowUI = TRUE)

Arguments

tag

Tag to check.

type

Expected type.

class

Expected class.

allowUI

?

Value

An error if conditions are not met

Examples

1
2
3
4
5
6
7
8
## Not run: 
 library(shiny)
 myTag <- div(class = "bg-blue")
 tagAssert(myTag, type = "div")
 tagAssert(myTag, type = "li") # will fail
 tagAssert(myTag, class = "bg-blue")

## End(Not run)

DivadNojnarg/outstanding-shiny-ui-code documentation built on Nov. 2, 2021, 12:03 p.m.