Wraps an R object in slickR compatible DOM

slick_div(
  x,
  css = htmltools::css(marginLeft = "auto", marginRight = "auto"),
  type = "img",
  links = NULL
)

Arguments

x

object

css

css object, Default: htmltools::css(marginLeft='auto',marginRight='auto')

type

character, type of DOM, Default: 'img'

links

character, links to use on the input object, Default: NULL

Value

list of shiny tag objects

Details

Method converts xml_document, htmlwidget, character, or list of objects to a compatible DOM

See also

Other html: slick_list()

Examples


# image
slick_div(nba_team_logo$uri[1])
#> [[1]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/atl.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 

# vector of images
slick_div(nba_team_logo$uri[c(1:5)])
#> [[1]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/atl.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 
#> [[2]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/bos.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 
#> [[3]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/bkn.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 
#> [[4]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/cha.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 
#> [[5]]
#> <img src="https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/chi.png&amp;h=512&amp;w=512" style="margin-left:auto;margin-right:auto;"/>
#> 

# text
slick_div('abc',type = 'p')
#> [[1]]
#> <p style="margin-left:auto;margin-right:auto;">abc</p>
#>