fdModal: Create a modal, popover or tooltip

Description Usage Arguments Examples

Description

This functions lets the user add a modal, popover or tooltip to a html element that will be displayed on click or hover.

Usage

1
2
3
4
5
fdModal(x, message, title = NULL, ..., .list = NULL)

fdPopover(x, message, title = NULL, ..., .list = NULL)

fdTooltip(x, message, title = NULL, ..., .list = NULL)

Arguments

x

html element

message

message to dispaly in modal

title

title to display in modal

...

additional arguments to pass to bootbox/bootstrap. See details.

.list

options as a list. makes it easier with programmatic generation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
library(flightdeck)
library(htmltools)

# Tooltlip
myIcon <- fdIcon("info-sign", lib = 'glyphicon') 
tooltipData <- list(
  message = 'This plot shows if residuals are normally distributed.', 
  title = 'Residuals', 
  placement = 'right'
)

box1 <- fdBox(title = span("Tooltip", myIcon %>% fdTooltip(.list = tooltipData))) 
box2 <-  fdBox(title = span("Popover", myIcon %>% fdPopover(.list = tooltipData)))
box3 <- fdBox(title = span("Modal", myIcon %>% fdModal(.list = tooltipData)))
myBoxes <- tagList(box1, box2, box3) 
if (interactive()){
  fdPreviewBoard(myBoxes, 'Modal, Tooltip and Popovers', wrapBox = F)
}
  


# Example 2
title <- span('Hello', 
  fdIcon('info-circle') %>%
    fdPopover(
      message = 'Welcome to flighdeck! The best dashboarding package ever.', 
      title = 'Hello'
    )
)
if (interactive()){
  fdBox(
    p("This is a really cool thing..."),
    title = title,
    footer = tags$small('Click on the info sign to view help.'),
    solidHeader = FALSE,
    status = 'danger'
  ) %>%
    fdPreview(wrapBox = F)
}

alteryx/flightdeck documentation built on May 12, 2019, 1:39 a.m.