Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs_current_theme

Obtain the currently active theme at render time


Description

Intended for advanced use by developers to obtain the currently active theme at render time and primarily for implementing themable widgets that can't otherwise be themed via bs_dependency_defer() .

Usage

bs_current_theme(session = get_reactive_domain())

Arguments

session

The current Shiny session (if any).

Details

This function should generally only be called at print/render time. For example:

Calling this function at print/render time is important because it does different things based on the context in which it's called:

  • If a reactive context is active, session$getCurrentTheme() is called (which is a reactive read).

  • If no reactive context is active, shiny::getCurrentTheme() is called (which returns the current app's theme, if relevant).

  • If shiny::getCurrentTheme() comes up empty, then bs_global_get() is called, which is relevant for rmarkdown::html_document(), and possibly other static rendering contexts.

Value

a bs_theme() object.


bslib

Custom 'Bootstrap' 'Sass' Themes for 'shiny' and 'rmarkdown'

v0.2.4
MIT + file LICENSE
Authors
Carson Sievert [aut, cre], Joe Cheng [aut], RStudio [cph], Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Javi Aguilar [ctb, cph] (Bootstrap colorpicker library), Thomas Park [ctb, cph] (Bootswatch library), PayPal [ctb, cph] (Bootstrap accessibility plugin)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.