unstrap: Remove bootstrap css from crosstalk components

View source: R/filters.R

unstrapR Documentation

Remove bootstrap css from crosstalk components

Description

The crosstalk injects Bootstrap into rendered HTML. unstrap() removes the Bootsrap dependencies from the components.

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)
}

co-analysis/govuk-hugo-r documentation built on June 23, 2022, 5:44 a.m.