Learn R Programming

⚠️There's a newer version (2.0.1) of this package.Take me there.

shinyMobile

shiny API for Framework7 (IOS/android)

Installation

# from CRAN
install.packages("shinyMobile")
# for the latest version
devtools::install_github("RinteRface/shinyMobile")

Cheatsheet

Demo

A running demo is on shinyapps.io. Left side: android demo, right side: iOS demo

Progressive Web App (PWA)

Configuration

shinyMobile is PWA capable, meaning that it can be displayed full screen on many mobile devices. This feature is automatically handled by f7Page():

shiny::tags$meta(name = "apple-mobile-web-app-capable", content = "yes"),
shiny::tags$meta(name = "theme-color", content = "#2196f3"),
shiny::tags$meta(name = "apple-mobile-web-app-status-bar-style", content="black-translucent"),
shiny::tags$link(rel = "apple-touch-icon", href = "icons/apple-touch-icon.png"),
shiny::tags$link(rel = "icon", href = "icons/favicon.png"),
shiny::tags$link(rel = "manifest", href = "manifest.json"),

However to access launch icons and splatch screens, you must create a manifest.json file and an icon asset folder in the www folder of your app: more here.

The manifest.json file could be like:

{
  "name": "My App",
  "short_name": "My App",
  "description": "My App",
  "lang": "en-US",
  "start_url": "https://dgranjon.shinyapps.io/miniUI2Demo/",
  "display": "standalone",
  "icons": [
    {
      "src": "icons/128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "icons/144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "icons/152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "icons/192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "icons/256x256.png",
      "sizes": "256x256",
      "type": "image/png"
    },
    {
      "src": "icons/512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Be sure to replace the start_url with your own url. Add also a custom name, even though this can be modified later when adding the PWA to your IOS apps. shinyMobile has an helper to create the manifest, that is create_manifest. However, it does not generate any icon nor splashscreens. Fortunately, there are tools such as appsco and app-manifest, to create those files.

Add the PWA to your desktop Apps

Go to the url of your app. In this example this is: https://dgranjon.shinyapps.io/miniUI2Demo/. It opens like a classic web app.

  • Select the share button located in the bottom bar of your Iphone/Ipad.
  • Click on "Add to Home Screen"
  • Choose a relevant name and click on OK.
  • The app will be added to your IOS Apps. In case you want custom icons, replace the content of the www folder with your own.

Acknowledgement

A special thanks to Vladimir Kharlampidi for creating this amazing framework7 HTML template.

Copy Link

Version

Install

install.packages('shinyMobile')

Monthly Downloads

671

Version

0.5.0.9000

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

David Granjon

Last Published

October 4th, 2024

Functions in shinyMobile (0.5.0.9000)

create_manifest

Create a manifest for your shiny app
createSelectOptions

Create option html tag based on choice input
f7AutoComplete

Create a Framework7 autocomplete input
f7Align

Create a Framework7 align
f7AccordionItem

Create a Framework7 accordion item
f7Back

Create a framework 7 back button
create_app_ui

Create the app UI
f7Accordion

Create a Framework7 accordion
f7Appbar

Create a Framework 7 appbar
f7ActionSheet

Create a framework7 action sheet
f7Card

Create a Framework7 card
f7ColorPicker

Create a Framework7 color picker input
f7ExpandableCard

Create a Framework7 expandable card
f7Col

Create a Framework7 column container
f7Button

Create a Framework7 button
f7BlockTitle

Create a Framework7 block title
f7Dialog

Create a Framework7 dialog window
f7DatePicker

Create a Framework7 date input
f7BlockFooter

Create a Framework7 block footer
f7Float

Create a Framework7 float
f7BlockHeader

Create a Framework7 block header
f7Found

Utility to display an item when the search is successful.
f7HideNavbar

Hide a framework7 navbar
f7HideOnEnable

f7Chip

Create a Framework7 chips
f7Fabs

Create a Framework7 container for floating action button (FAB)
f7Messages

Create a Framework7 messages container
f7Password

Create an f7 password input
f7Navbar

Create a Framework7 Navbar
f7Icon

Create a Framework7 icon
f7Fab

Create a Framework7 floating action button (FAB)
f7HideOnSearch

Utility to hide a given tag on search
f7Gallery

Launch the shinyMobile Gallery
f7Gauge

Create a Framework7 gauge
f7List

Create a framework 7 contact list
f7PanelItem

Create a Framework7 sidebar menu item
f7Link

Create a Framework7 link
f7PanelMenu

Create a Framework7 sidebar menu
f7SearchIgnore

Utility to ignore an item from search.
f7Row

Create a Framework7 row container
f7Block

Create a Framework7 block
f7Badge

Create a Framework7 badge
f7Init

Custom initialization
f7Flex

Create a Framework7 flex container
f7Margin

Create a Framework7 margin
f7Next

Create a framework 7 next button
f7Message

Create a framework7 message
f7FabClose

f7Picker

Create a Framework7 picker input
f7NotFound

Utility to display an item when the search is unsuccessful.
f7Popover

Create a framework 7 popover
f7SearchbarTrigger

Create a Framework 7 searchbar trigger
f7Searchbar

Create a Framework 7 searchbar
f7Swiper

Create a Framework7 swiper
f7Item

f7FabMorphTarget

Convert a tag into a target morphing
f7Items

f7ListGroup

Create a framework 7 group of contacts
f7ListIndex

Create a Framework 7 list index
f7PhotoBrowser

Create a fremework7 photo browser
f7Skeleton

Create a Framework 7 skeleton loading overlay
f7Slider

Create a f7 slider
f7PopoverTarget

Define a popover target
f7Popup

Create a f7 popup
f7Slide

Create a Framework7 slide
f7Sheet

Create an f7 sheet modal
f7Shadow

Create a Framework7 shadow effect
f7InsertTab

f7Tab

Create a Framework7 tab item
f7TapHold

Create a Framework7 tapHold event
f7Text

Create an f7 text input
f7Tabs

Create a Framework7 tabs
f7SmartSelect

Create a Framework7 smart select
f7TabLayout

Create a Framework7 page with tab layout
f7Padding

Create a Framework7 padding
f7Progress

Create a Framework7 progress bar
f7Notif

Create a Framework7 notification
f7ProgressInf

Create a Framework7 infinite progress bar
f7ListIndexItem

Create a Framework 7 list index item
f7Tooltip

Create a Framework7 tooltip
f7checkBox

Create a F7 Checkbox
updateF7Card

Update a framework 7 expandable card
f7Segment

Create a Framework7 segmented button container
f7SocialCard

Create a Framework7 social card
f7SplitLayout

Create a Framework7 split layout
f7Toast

Create a Framework7 toast
f7Toggle

Create a F7 toggle switch
f7Page

Create a Framework7 page
f7Radio

Create an f7 radio button input
f7ListItem

Create a Framework 7 contact item
f7Panel

Create a Framework7 panel
f7SwipeoutItem

Create a framework7 swipeout item
f7TogglePopup

f7Swipeout

Create a framework7 swipeout element
f7Select

Create an f7 select input
updateF7Checkbox

Change the value of a checkbox input on the client
f7Toolbar

Create a Framework7 Toolbar
f7RemoveTab

f7SingleLayout

Create a Framework7 single layout
f7ShowNavbar

Show a framework7 navbar
updateF7Sheet

update a framework 7 sheet modal
updateF7Select

Change the value of a select input on the client
updateF7Toggle

Change the value of a toggle input on the client
f7Stepper

Create a F7 radio stepper
updateF7Accordion

Update a Framework 7 accordion
updateF7AutoComplete

Change the value of an autocomplete input on the client
f7SubNavbar

Create a Framework7 sub navbar
updateF7Gauge

update a framework7 gauge from the server side
f7TimelineItem

Create a Framework7 timeline item
f7Timeline

Create a Framework7 timeline
updateF7Slider

Change the value of a slider input on the client
updateF7Stepper

Change the value of a stepper input on the client
f7checkBoxGroup

Create an f7 checkbox group input
updateF7Tabs

Update a Framework 7 tabsetPanel
reexports

Objects exported from other packages
preview_mobile

Allow to preview a given app on different devices.
updateF7Progress

update a framework7 progress bar from the server side
updateF7Picker

Change the value of a picker input on the client
getF7Colors

Function to get all colors available in shinyMobile
updateF7Text

Change the value of a text input on the client
updateF7DatePicker

Change the value of a date picker input on the client
updateF7Fab

Change the value of a f7Fab input on the client
updateF7Panel