Components

It may be useful to wrap a few Bootstrap components:

These components will be wrapped in a future version:

bs_button()

Button

bs_panel()

Panel

Collapse, accordion, and accordion sidebar

All of these functions deal with collapsible elements. The foundation is the collapse element; upon this, you can build a set of accordion panels. For shiny apps, the accordion-sidebar framework may be useful as it can give you another dimension with which to organize your UI.

The verb attach is used with collapse elements; you create a collapse element, then attach its id to a link or button tag. For accordions and accordion sidebars, you create the framework tag, then append elements using the pipe. Also, accordion-sidebars require activation, which you can do by calling use_bs_accordion_sidebar() once on your page.

bs_collapse() bs_attach_collapse()

Collapsible element

bs_accordion() bs_append(<bsplus_accordion>) bs_set_opts(<bsplus_accordion>)

Accordion panel-group

bs_accordion_sidebar() use_bs_accordion_sidebar() bs_append(<bsplus_accordion_sidebar>) bs_set_opts(<bsplus_accordion_sidebar>)

Accordion-sidebar panel-group

Tooltip, popover, and modal window

Tooltips, popovers, and modals can be useful for including extra information in your rmarkdown document or your shiny app.

You can see tooltips, popovers, and modal windows in this shiny app. Different verbs are associated with these elements: you embed tooltips and popovers into tags; whereas you create a modal element, then attach its id to a tag. Also, tooltips and popovers require activation, which you can do calling use_bs_tooltip() or use_bs_popover() once on your page.

bs_embed_tooltip() use_bs_tooltip()

Tooltip

bs_embed_popover() use_bs_popover()

Popover

bs_modal() bs_modal_closebutton() bs_attach_modal()

Modal window

Carousels are used to contain sets of “content”, while showing one element of the set at a time. Generally, the content are images, but it can be any HTML. One way that a this could be a more-useful tool if an “easy” way can be found to populate a carousel with images produced by gganimate.

bs_append(<bsplus_carousel>) bs_carousel()

Carousel

bs_carousel_image()

Carousel image

bs_carousel_caption()

Carousel caption

Shiny UI extensions

One of the more-specific goals of this package is to make it easier to incorporate help-documentation into your shiny apps. Some helper functions are provided to create help-links, then embed them into labels of shiny inputs. You can see these helper functions in action in this shiny app.

shiny_iconlink()

Create link containing Shiny icon

shinyInput_label_embed()

Embed an element into the label of a Shiny-input tag

Helpers

The function bs_set_data() makes things a little easier for you by prepending "data-" to each name and serializing values to the format specified by the Bootstrap API. The function bs_set_aria() works similarly to prepend "aria-" to each name.

bs_set_data() bs_set_aria()

Sets Bootstrap data- and aria- attributes.

render_html_fragment()

Renders and returns an HTML fragment