Learn R Programming

shinyMobile (version 0.7.0)

f7SplitLayout: Create a Framework7 split layout

Description

This is a modified version of the f7SingleLayout. It is intended to be used with tablets.

Usage

f7SplitLayout(
  ...,
  navbar,
  sidebar,
  toolbar = NULL,
  panels = NULL,
  appbar = NULL
)

Arguments

...

Content.

navbar

Slot for f7Navbar.

sidebar

Slot for f7Panel. Particularly we expect the following code: f7Panel(title = "Sidebar", side = "left", theme = "light", "Blabla", style = "reveal")

toolbar

Slot for f7Toolbar.

panels

Slot for f7Panel. Expect only a right panel, for instance: f7Panel(title = "Left Panel", side = "right", theme = "light", "Blabla", style = "cover")

appbar

Slot for f7Appbar.

Examples

Run this code
# NOT RUN {
if(interactive()){
 library(shiny)
 library(shinyMobile)
 shiny::shinyApp(
   ui = f7Page(
     title = "My app",
     f7SplitLayout(
       sidebar = f7Panel(
         inputId = "sidebar",
         title = "Sidebar",
         side = "left",
         theme = "light",
         f7PanelMenu(
           id = "menu",
           f7PanelItem(tabName = "tab1", title = "Tab 1", icon = f7Icon("email"), active = TRUE),
           f7PanelItem(tabName = "tab2", title = "Tab 2", icon = f7Icon("home"))
         ),
         effect = "reveal"
       ),
       navbar = f7Navbar(
         title = "Split Layout",
         hairline = FALSE,
         shadow = TRUE
       ),
       toolbar = f7Toolbar(
         position = "bottom",
         f7Link(label = "Link 1", src = "https://www.google.com"),
         f7Link(label = "Link 2", src = "https://www.google.com", external = TRUE)
       ),
       # main content
       f7Items(
         f7Item(
           tabName = "tab1",
           f7Slider("obs", "Number of observations:",
                       min = 0, max = 1000, value = 500
           ),
           plotOutput("distPlot")
         ),
         f7Item(tabName = "tab2", "Tab 2 content")
       )
     )
   ),
   server = function(input, output) {

     observe({
       print(input$menu)
     })

     output$distPlot <- renderPlot({
       dist <- rnorm(input$obs)
       hist(dist)
     })
   }
 )
}

# }

Run the code above in your browser using DataLab