ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
146 stars 23 forks source link

some fundamental components #22

Open ijlyttle opened 7 years ago

ijlyttle commented 7 years ago

http://getbootstrap.com/components/

ijlyttle commented 7 years ago

What shall the API look like?

Reference

button

bs_buttton <- function(label, button_type = "default", ...)
Argument Description
label character (HTML), button label
button_type character, one of "default", "primary", ...
... passed to tags$button(), named args passed to tagAppendAttributes(), unnamed args become children

You can change the size of the buttons, but I don't think that would be used too often - perhaps just note in the documentation that this can be addressed with a class specification.

panel

bs_panel <- function(panel_type = "default", heading = NULL, content = NULL, footer = NULL, ...)

bs_panel_title <- function(title = NULL) 
Argument Description
panel_type character, one of "default", "primary", ...
heading character (HTML) for panel heading, use bs_panel_title() to use title styling
content character (HTML) content for panel body
footer character (HTML) for panel footer
... passed to tags$div() for panel, named args passed to tagAppendAttributes(), unnamed args become children
title character (HTML) to wrap in in title-styling

well

bs_well(size = c("medium", "large", "small"), ...)
Argument Description
size character, well size
... passed to tags$div() for well, named args passed to tagAppendAttributes(), unnamed args become children

responsive embed

bs_wrap_responsive <- function(tag, aspect_ratio = c("16by9", "4by3"))
Argument Description
tag HTML, <iframe/> (maybe warn if not iframe)
aspect_ratio character, aspect ratio for the embed