unstrap {govdown}R Documentation

Remove bootstrap css from crosstalk components

Description

If your page renders weirdly, it might be because a crosstalk component like crosstalk::filter_select() is injecting unexpected css into your page, which happens because they try to use the Bootstrap css library by default. The unstrap() function prevents that from happening.

Usage

unstrap(x)

Arguments

x

a crosstalk component, such as crosstalk::filter_select()

Value

The component x but with any "boostrap" dependency removed from its html_dependencies attribute.

Examples

# The fs object will inject css into your page.
if (requireNamespace("crosstalk", quietly = TRUE)) {
  df <- crosstalk::SharedData$new(mtcars)

  fs <- crosstalk::filter_select(
      id = "myselector",
      label = "select something",
      sharedData = df,
      group = ~cyl
    )

  # The fs_nobootstrap object won't inject css into your page.
  fs_nobootstrap <- unstrap(fs)
}

[Package govdown version 0.10.1 Index]