Skip to main content

page_deps

page_deps(theme=None, *extra, components=None)

The HTML dependencies bslibreact’s components need at runtime.

Attach the result to a shinyreact page, for example page_react(page_deps(app_theme), theme=app_theme). A client with no build step also attaches :func:bslibreact_dep. It works by rendering a representative sample of the markup catalog – the same sample calls the catalog renderer uses for bslibreact markup – and reading back whichever :class:~htmltools.HTMLDependency objects that markup pulled in, minus the ones every shiny page already attaches on its own: bootstrap, jquery, and the theme stylesheet (shiny-theme-*), which the page’s own theme= supplies.

Parameters

Name Type Description Default
theme str | Path | Theme | None The page’s theme: None, a str/Path to a _brand.yml, or a :class:shiny.ui.Theme. Validated but not used yet (py-shiny themes component CSS from the page’s own theme); it keeps the call the same as R’s page_deps() and leaves room to use it later. None
*extra 'TagChild' Additional tags to render alongside the catalog sample – typically the actual inputs and outputs your page uses, so their dependencies are included too even if the catalog doesn’t happen to cover them. ()
components Sequence[str] | None Catalog sample names to render, instead of every "tag"/"page" sample. Pass [] to render none of the catalog (only *extra). Unknown names raise ValueError. None

Returns

Name Type Description
A TagList class:~htmltools.TagList of :class:~htmltools.HTMLDependency
TagList objects, ready to splat into a page.