tinyslider-shiny: Shiny bindings for tinyslider

Description Usage Arguments Examples

Description

Output and render functions for using tinyslider within Shiny applications and interactive Markdown documents.

Usage

1
2
3
tinysliderOutput(outputId, width = "100%", height = "400px")

renderTinyslider(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a tinyslider

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
if (interactive()) {
library(shiny)
library(tinyslider)

ui <- fluidPage(
  tinysliderOutput("test")
)
server <- function(input, output, session) {

  output$test <- renderTinyslider({
    tinyslider(
      tinyslider_card(
        title = "First title",
        subtitle = "First subtitle",
        content = paste0("Lorem Ipsum is simply dummy text of the",
        "printing and typesetting industry. Lorem Ipsum has been the",
         "industry's standard dummy text ever since the 1500s, when",
         "an unknown printer took a galley of type and scrambled",
          "it to make a type specimen book."),
        image = "https://placeimg.com/200/150/nature"
      ),
      tinyslider_card(
        "Second title",
        "Second subtitle",
        "There is a button below",
        button_text = "See more",
        image = "https://placeimg.com/200/150/nature/2"
      ),
      tinyslider_card(
        "Third title",
        subtitle = NULL,
        content = paste0("Lorem Ipsum is simply dummy text of the",
        "printing and typesetting industry. Lorem Ipsum has been",
        "the industry's standard dummy text ever since the",
        "1500s, when an unknown printer took a galley of type and",
        "scrambled it to make a type specimen book. It has",
        "survived not only five centuries, but also the leap into",
        "electronic typesetting, remaining essentially unchanged.",
        "It was popularised in the 1960s with the",
        "release of Letraset sheets containing Lorem Ipsum passages,",
        "and more recently with desktop publishing",
        "software like Aldus PageMaker including versions of Lorem Ipsum.")
      ),
      options = list(
        loop = TRUE,
        autoplay = TRUE,
        autoplayTimeout = 1000
      )
    )
  })
}

shinyApp(ui, server, options = list(launch.browser = TRUE))
}

etiennebacher/shinymisc documentation built on Jan. 1, 2021, 1:14 a.m.