Skip to contents

f7checkBox creates a checkbox input. Use f7Checkbox instead.

f7checkBoxGroup creates a checkbox group input. Use f7CheckboxGroup instead

removeF7Tab removes an f7Tab in an f7Tabs. Use removeF7Tab instead

f7ValidateInput validates a given shinyMobile input. Use validateF7Input instead

f7AddMessages adds messages to an f7Messages container. Use updateF7Messages instead

f7HideNavbar hides an f7Navbar component from the server. Use updateF7Navbar instead.

f7ShowNavbar shows an f7Navbar component from the server. Use updateF7Navbar instead.

f7Popover is deprecated. It has to be used in an oberve or observeEvent context. Only works for input elements!

f7PopoverTarget is deprecated. This must be used in combination of f7Popover. Only works for input elements!

f7ShowPreloader shows a preloader. Use showF7Preloader instead

hideF7Preloader hides a preloader. Use f7HidePreloader instead

create_manifest creates a manifest for your shiny App. Please use this workflow instead: https://unleash-shiny.rinterface.com/mobile-pwa.html#charpente-and-pwa-tools.

Usage

f7checkBox(inputId, label, value = FALSE)

f7checkBoxGroup(inputId, label, choices = NULL, selected = NULL)

f7InsertTab(
  id,
  tab,
  target,
  position = c("before", "after"),
  select = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

f7RemoveTab(id, target, session = shiny::getDefaultReactiveDomain())

f7ValidateInput(
  inputId,
  info = NULL,
  pattern = NULL,
  error = NULL,
  session = shiny::getDefaultReactiveDomain()
)

f7AddMessages(
  id,
  messages,
  showTyping = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

f7HideNavbar(
  animate = TRUE,
  hideStatusbar = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

f7ShowNavbar(animate = TRUE, session = shiny::getDefaultReactiveDomain())

f7Popover(targetId, content, session = shiny::getDefaultReactiveDomain())

f7PopoverTarget(tag, targetId)

f7ShowPreloader(
  target = NULL,
  color = NULL,
  session = shiny::getDefaultReactiveDomain()
)

hideF7Preloader(target = NULL, session = shiny::getDefaultReactiveDomain())

create_manifest(
  path,
  name = "My App",
  shortName = "My App",
  description = "What it does!",
  lang = "en-US",
  startUrl,
  display = c("minimal-ui", "standalone", "fullscreen", "browser"),
  background_color = "#000000",
  theme_color = "#0000ffff",
  icon
)

Arguments

inputId

Input to validate.

id

f7Tabs id.

tab

f7Tab to insert.

target

f7Tab after of before which the new tab will be inserted.

position

Insert before or after: c("before", "after").

select

Whether to select the newly inserted tab. FALSE by default.

session

shiny session.

info

Additional text to display below the input field.

pattern

Pattern for validation. Regex.

error

Error text.

messages

List of f7Messages.

showTyping

Show typing when a new message comes. Default to FALSE. Does not work yet...

animate

Whether it should be hidden with animation or not. By default is TRUE.

hideStatusbar

When FALSE (default) it hides navbar partially keeping space required to cover statusbar area. Otherwise, navbar will be fully hidden.

targetId

Popover id. Must correspond to the f7Popover targetId.

content

Popover content.

tag

Tag that will be targeted. Must be a f7Input element.

color

Preloader color.

path

package path.

name

App name.

shortName

App short name.

description

App description

lang

App language (en-US by default).

startUrl

Page to open at start.

display

Display mode. Choose among c("minimal-ui", "standalone", "fullscreen", "browser"). In practice, you want the standalone mode so that the app looks like a native app.

background_color

The background_color property is used on the splash screen when the application is first launched.

theme_color

The theme_color sets the color of the tool bar, and may be reflected in the app's preview in task switchers.

icon

Dataframe containing icon specs. src gives the icon path (in the www folder for instance), sizes gives the size and types the type.

Value

This function creates a www folder for your shiny app. Must specify the path. It creates 1 folders to contain icons and the manifest.json file.

Examples

if (interactive()) {
 library(shiny)
 library(shinyMobile)

 shinyApp(
    ui = f7Page(
       title = "Hide navbar",
       f7SingleLayout(
          navbar = f7Navbar("Hide/Show navbar"),
          f7Segment(
             f7Button(inputId = "hide", "Hide navbar", color = "red"),
             f7Button(inputId = "show", "Show navbar", color = "green"),
          )
       )
    ),
    server = function(input, output, session) {

       observeEvent(input$hide, {
          f7HideNavbar()
       })

       observeEvent(input$show, {
          f7ShowNavbar()
       })
    }
 )
}
if (interactive()) {
 library(shiny)
 library(shinyMobile)
 shinyApp(
   ui = f7Page(
     title = "f7Popover",
     f7SingleLayout(
       navbar = f7Navbar(title = "f7Popover"),
       f7PopoverTarget(
         f7Button(
           inputId = "goButton",
           "Go!"
         ),
         targetId = "test"
       ),
       br(),
       br(),
       f7PopoverTarget(
         f7Slider(
           inputId = "slider",
           label = "Value",
           value = 10,
           min = 0,
           max = 20
         ),
         targetId = "test2"
       )
     )
   ),
   server = function(input, output, session) {
     observe({
       f7Popover(
         targetId = "test",
         content = "This is a f7Button"
       )
     })

     observe({
       f7Popover(
         targetId = "test2",
         content = "This is a f7Slider"
       )
     })
   }
 )
}
create_manifest(
  path = tempdir(),
  name = "My App",
  shortName = "My App",
  description = "What it does!",
  lang = "en-US",
  startUrl = "https://www.google.com/",
  display = "standalone",
  background_color = "#3367D6",
  theme_color = "#3367D6",
  icon = data.frame(
    src = "icons/128x128.png",
    sizes = "128x128", 10,
    types = "image/png"
  )
)
#> Warning: create_manifest will be removed in future release. Please use
#>     the workflow described at https://unleash-shiny.rinterface.com/mobile-pwa.html#charpente-and-pwa-tools instead.
#> {
#>   "name": "My App",
#>   "short_name": "My App",
#>   "description": "What it does!",
#>   "lang": "en-US",
#>   "start_url": "https://www.google.com/",
#>   "display": "standalone",
#>   "background_color": "#3367D6",
#>   "theme_color": "#3367D6",
#>   "icon": [
#>     {
#>       "src": "icons/128x128.png",
#>       "sizes": "128x128",
#>       "X10": 10,
#>       "types": "image/png"
#>     }
#>   ]
#> }