if(interactive()){
library(shiny)
library(shinyMobile)
timeline <- f7Timeline(
sides = TRUE,
f7TimelineItem(
"Another text",
date = "01 Dec",
card = FALSE,
time = "12:30",
title = "Title",
subtitle = "Subtitle",
side = "left"
),
f7TimelineItem(
"Another text",
date = "02 Dec",
card = TRUE,
time = "13:00",
title = "Title",
subtitle = "Subtitle"
),
f7TimelineItem(
"Another text",
date = "03 Dec",
card = FALSE,
time = "14:45",
title = "Title",
subtitle = "Subtitle"
)
)
shiny::shinyApp(
ui = f7Page(
title = "Swiper",
f7SingleLayout(
navbar = f7Navbar(title = "f7Swiper"),
f7Swiper(
id = "my-swiper",
f7Slide(
timeline
),
f7Slide(
f7Toggle(
inputId = "toggle",
label = "My toggle",
color = "pink",
checked = TRUE
),
verbatimTextOutput("test")
),
f7Slide(
f7Slider(
inputId = "obs",
label = "Number of observations",
max = 1000,
min = 0,
value = 100,
scaleSteps = 5,
scaleSubSteps = 3,
scale = TRUE,
color = "orange",
labels = tagList(
f7Icon("circle"),
f7Icon("circle_fill")
)
),
plotOutput("distPlot")
)
)
)
),
server = function(input, output) {
output$test <- renderPrint(input$toggle)
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
)
}
Run the code above in your browser using DataLab