Last data update: 2014.03.03

R: Create a bootstrap button with popover
popoverR Documentation

Create a bootstrap button with popover

Description

Add small overlays of content for housing secondary information.

Usage

popover(title, content, header = NULL, html = TRUE,
  class = "btn btn-default", placement = c("right", "top", "left",
  "bottom"), trigger = c("click", "hover", "focus", "manual"))

Arguments

title

character (required): Title of the button.

content

character: Text to be displayed in the popover.

header

character: Optional header in the popover.

html

logical Insert HTML into the popover.

class

logical Bootstrap button class (e.g. "btn btn-danger").

placement

character: How to position the popover - top | bottom | left | right | auto. When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.

trigger

character: How popover is triggered - click | hover | focus | manual.

Examples

# html code
popover("title", "Some content")

# example app
## Not run: 
shinyApp(
ui = fluidPage(
  jscolorInput(inputId = "col", label = "JSColor Picker",
               value = "21BF6B", position = "right",
               mode = "HVS", close = TRUE),
  popover(title = "Help!", content = "Call 911"),
  plotOutput("plot")
),
server = function(input, output) {
  output$plot <- renderPlot({
    plot(cars, col = input$col, cex = 2, pch = 16)
 })
})

## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RLumShiny)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RLumShiny/popover.Rd_%03d_medium.png", width=480, height=480)
> ### Name: popover
> ### Title: Create a bootstrap button with popover
> ### Aliases: popover
> 
> ### ** Examples
> 
> # html code
> popover("title", "Some content")
<a tabindex="0" role="button" class="btn btn-default" data-toggle="popover" data-content="Some content" data-animation="TRUE" html="TRUE" data-placement="right" data-trigger="click">title</a>
> 
> # example app
> ## Not run: 
> ##D shinyApp(
> ##D ui = fluidPage(
> ##D   jscolorInput(inputId = "col", label = "JSColor Picker",
> ##D                value = "21BF6B", position = "right",
> ##D                mode = "HVS", close = TRUE),
> ##D   popover(title = "Help!", content = "Call 911"),
> ##D   plotOutput("plot")
> ##D ),
> ##D server = function(input, output) {
> ##D   output$plot <- renderPlot({
> ##D     plot(cars, col = input$col, cex = 2, pch = 16)
> ##D  })
> ##D })
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>