The fact that there is more than one item on this list suggests that this should be more than one package, I hope that I will be forgiven for keeping them together at this nascent stage.
It may be useful to prepend all the functions with bs_, to keep the namespace clean.
Grammar
bs_noun() We are creating a thing.
bs_noun_verb(thing, ...) We are taking an action on the thing.
bs_noun1_verb_noun2(thing1, thing2) We are taking an action on thing1 using thing2.
If we have an S3 class, then:
bs_verb(thing, ...) We are taking an action on the thing.
bs_verb_noun(thing1, thing2) We are taking an action on thing1 using thing2.
Verbs
bs_append(tag, ...) we are appending something to the tag, perhaps a panel into a panel-group, or a set of attributes.
bs_attach(tag, ...) we are attaching something to the tag
bs_emded(tag, ...) we are embed something as part of the tag
bs_set_opts(tag, ...) we are setting some options for the tags yet to be appended
Let's consider the differences betweenappend, attach, and embed.
We can append more than one element to a tag, i.e., we would append multiple panel elements to an accordion.
We can attach only one thing to a tag. When we are attaching, we attach the id of an element, not the element itself.
We can embed only one thing into a tag. i.e., into a given tag, we embed a tooltip or a popover, modifying the attributes and setting a child element.
Note
Going back-and-forth a lot in my head as to the extent to which these functions should use the S3 framework.
Helper function
bs_set_data(tag, ...)
bs_set_aria(tag, ...)
for the each of the named ... args
prefixes the names with data- or aria-
converts logical values to "true" and "false"
converts lubridate durations to milliseconds
converts vectors to space-delimited character strings
Note we have to go around the htmltools API to set (rather than append) the attributes - this will need to be addressed.
Components
For the first pass of this package, it is proposed to provide access to some useful components not already offered in Shiny:
tags$button("John Lennon") %>%
bs_embed_popover(
title = "More information",
content = "Although he wrote \"I Am the Walrus\", he later insisted that the Walrus was Paul."
)
The purposes of the bsplus package:
The fact that there is more than one item on this list suggests that this should be more than one package, I hope that I will be forgiven for keeping them together at this nascent stage.
It may be useful to prepend all the functions with
bs_
, to keep the namespace clean.Grammar
bs_noun()
We are creating a thing.bs_noun_verb(thing, ...)
We are taking an action on thething
.bs_noun1_verb_noun2(thing1, thing2)
We are taking an action onthing1
usingthing2
.If we have an S3 class, then:
bs_verb(thing, ...)
We are taking an action on thething
.bs_verb_noun(thing1, thing2)
We are taking an action onthing1
usingthing2
.Verbs
bs_append(tag, ...)
we are appending something to the tag, perhaps a panel into a panel-group, or a set of attributes.bs_attach(tag, ...)
we are attaching something to the tagbs_emded(tag, ...)
we are embed something as part of the tagbs_set_opts(tag, ...)
we are setting some options for the tags yet to be appendedLet's consider the differences between
append
,attach
, andembed
.Note
Going back-and-forth a lot in my head as to the extent to which these functions should use the S3 framework.
Helper function
for the each of the named
...
argsdata-
oraria-
"true"
and"false"
Note we have to go around the htmltools API to set (rather than append) the attributes - this will need to be addressed.
Components
For the first pass of this package, it is proposed to provide access to some useful components not already offered in Shiny:
We also propose a compound component:
Collapse
Example
Accordion
S3 class
Example
Modal
Helpers
Need to think this through
Example
Tooltip
Example
Popover
Example
Carousel
S3 Class
Example
Accordion Sidebar
This is an add-on that makes it easier to fit more stuff into a shiny app. S3 class