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

Simplifies custom 'CSS' styling of both 'shiny' and 'rmarkdown' via 'Bootstrap' 'Sass'. Supports 'Bootstrap' 3, 4 and 5 as well as their various 'Bootswatch' themes. An interactive widget is also provided for previewing themes in real time.


bslib

CRANstatus bslib statusbadge R buildstatus

The bslib R package provides a modern UI toolkit for Shiny and R Markdown based on Bootstrap. It facilitates:

  • Creation of delightful and customizable Shiny dashboards.
    • The underlying UI components (e.g., cards, value boxes, sidebars, etc) are also designed to work in other contexts (e.g., in R Markdown).
  • Custom theming of Shiny apps and R Markdown documents.
    • Apps can even be themed interactively in real-time.
  • Use of modern versions of Bootstrap and Bootswatch
    • Shiny and R Markdown currently default to Bootstrap 3 and may continue to do so to maintain backwards compatibility.

Installation

Install the bslib package from CRAN as follows:

install.packages("bslib")

An example

The quickest way to see what {bslib} can do is to run bslib::bs_theme_preview() at the console. This launches a demo app containing both {bslib} and {shiny} UI components as well as an theming widget (bslib::bs_themer()) overlaid on the app. See real-time theming to learn more.

An animation showing bslib theming app. As the user changes the Bootswatch theme and Bootstrap settings, the app's appearance changes in real-time.

Get started

Since {bslib} covers a wide array of uses, it has numerous getting started articles, each focusing on a particular interest:

Getting help

There are two main places to get help with bslib:

  • The RStudio community is a friendly place to ask any questions (be sure to add a bslib tag when creating a topic).

  • Stack Overflow is a great source of answers to common bslib questions. It is also a great place to get help, once you have created a reproducible example that illustrates your problem. Use the tags [r][bslib] if you ask a question. Add the tag [bslib] if you are using a Shiny runtime.

Code of Conduct

Please note that the bslib project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bslib")

0.12.0 by Carson Sievert, 2 months ago


https://rstudio.github.io/bslib/, https://github.com/rstudio/bslib


Report a bug at https://github.com/rstudio/bslib/issues


Browse source code at https://github.com/cran/bslib


Authors: Carson Sievert [aut, cre] (ORCID: , Joe Cheng [aut] , Garrick Aden-Buie [aut] (ORCID: , Posit Software , PBC [cph, fnd] , 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)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports base64enc, cachem, fastmap, grDevices, htmltools, jquerylib, jsonlite, lifecycle, memoise, mime, rlang, sass

Suggests brand.yml, bsicons, curl, fontawesome, future, ggplot2, knitr, lattice, magrittr, rappdirs, rmarkdown, shiny, testthat, thematic, tools, utils, withr, yaml


Imported by AssumpSure, Blaunet, Certara.DarwinReporter, Certara.ModelResults, Certara.RsNLME.ModelBuilder, Certara.RsNLME.ModelExecutor, Certara.VPCResults, ComBatFamQC, DataCraftR, DataEditR, DepMod, EZRShiny, ElicitationWizard, ErlangC, FAfA, FastRet, G2Sd, GLMBasedRaschEstimation, GRShiny, GenoTriplo, IsoCor, LLMR.shiny, MLmorph, MappingCalc, NetSimR, OmopViewer, PICOTsize, PKbioanalysis, PRISMA2020, PatientGenerator, QuickExplore, R4GoodPersonalFinances, REDCapCAST, RedeAgroRadar, Rigma, RobustFlow, SampleSizeCalculator, ShinyBlock, SouthParkRshiny, WMFM, agcounts, aweSOM, blockr.core, blockr.dock, blockr.dplyr, blockr.io, bravo, bs4Dash, bslibdash, calms, cataScience, catekappa, chattr, commons, connectwidgets, courieR, cpam, datacleanr, datamods, designer, dqcheckrGUI, dragonfarm, eCerto, epiworldRShiny, esquisse, famnesia, fioRa, fitODBODRshiny, flexdashboard, fresh, ggstratify, gptstudio, handwriterApp, inDAGO, inshiny, isoexplorer, jsmodule, kinesis, lakhesis, link, mappingAS, mapsf.gui, mergenstudio, metainsight, multigroup.vaccine, multilevelcoda, ncmR, nprcgenekeepr, oceanexplorer, octopus, oglcnac, ordinalsimr, pannotator, pioneeR, pkgdown, pmxcode, polarisR, praatpicture, pressfreedom, qrlabelr, quallmer.app, querychat, radiant.data, rclipboard, retistruct, rmarkdown, rvisual, santaR, sdstudio, shidashi, shiny, shiny.ollama, shinyCohortBuilder, shinyExprPortal, shinyWidgets, shinychat, shinydataviewer, shinygenui, shinyglass, shinymrp, spada, starry, stepssurvey, sunburstShinyWidget, teal, teal.modules.clinical, teal.modules.general, teal.reporter, teal.slice, teal.widgets, tfrmtbuilder, unhcrdown, valdrViz, visvaR, wowi.

Depended on by whalestrike.

Suggested by BEMPdata, CiteSource, ConSciR, DT, DT2, EDCimport, EpiModel, FitVerse, FocusGroup, HOME, LLMRpanel, LRErdd, MAIHDA, MVN, NDPalette, OPCC, PhenotypeR, PsyMetricTools, R4VN, REXoplanets, RMSTpowerBoost, Rnaught, SHARK4R, SSVS, ShinyWizard, a11yShiny, actxps, aifeducation, albersdown, alphavantagepf, amapGeocode, amp.sim, annotator, apa7, apsimeval, aurora, bookdown, brandr, bs4cards, bsicons, btw, crosstalk, dataganger, dendRoAnalyst, dtsmartr, earthUI, eq5dsuite, facetsviz, fcaR, finlabR, foresty, g6R, geocmeans, geommc, geslaR, ggDNAvis, gglm, ggpaintr, glasstabs, glcdp, grip, highdir, histoslider, htaBIM, ibger, imagefluency, irid, jqbr, kgraph, knitr, krt, kuzco, learnr, leprechaun, lexsync, linkagg, linkeR, litReview, locatr, logolink, mapmixture, metasurvey, micromodal, mlr3shiny, nocturn, nowcastr, optimall, pdfcombiner, pizzarr, quadkeyr, quarto, qviewparsR, raretrans, rasch, revealjs, rfair, scopusflow, screenllm, sdbuildR, shiny.destroy, shinyGovstyle, shinyMobile, shinyOAuth, shinySelect, shinyWGD, shinydashboardPlus, shinyds, shinyfilters, shinyscholar, shinysnap, shinystate, snapr, soilKey, soundgen, spCF, staat1cho, stratifyR, surreal, survSampleSize, targets, teal.transform, theft, theftdlc, thematic, themescopeR, toastui, triageR, vchartr, visOmopResults.


See at CRAN