Learn R Programming

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

shinyMobile

Develop outstanding {shiny} apps for iOS, Android, desktop as well as beautiful {shiny} gadgets. {shinyMobile} is built on top of the latest Framework7 template.

Installation

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

Cheatsheet

Demo

A running demo is available here : https://dgranjon.shinyapps.io/miniUI2Demo/. 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() and the Google PWA compatibility script. The last 3 parameters of f7Page() are not mandatory. If not provided, the app will use shinyMobile default ressources to create an apple-touch-icon, a manifest and a favicon. The PWA compatibility script will automatically create any missing icons and splash screens for iOS and Android devices.

Below is an example showing the manifest.json file:

{
  "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. Also, add 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. FInally, there are tools such as appsco and app-manifest, to create those custom icons and splash screens, if you need to.

Add the PWA to your desktop Apps

Copy the url of your app in your mobile web browser (iOS: Safari and Andoid: Chrome). In this example this is: https://dgranjon.shinyapps.io/miniUI2Demo/. It opens like a classic web app, with top and bottom ugly navigation bars.

  • Select the share button located in the bottom bar of your Iphone/Ipad. For Android,

you may do something similar. Importantly, Chrome for iOS does not support this feature, that's why I recommend using Safari.

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

Limitations

It is actually quite complex to guarantee that all mobile platforms are supported. The PWA compatibility script will work in most of the case. If not, please open an issue here, to help improving it!

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.7.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

David Granjon

Last Published

June 17th, 2020

Functions in shinyMobile (0.7.0)

f7Accordion

Create a Framework7 accordion
f7Align

Create a Framework7 align
create_app_ui

Create the app UI
f7ActionSheet

Create a framework7 action sheet
f7AccordionItem

Create a Framework7 accordion item
createSelectOptions

Create option html tag based on choice input
f7AddMessages

Update f7Messages on the server side.
create_manifest

Create a manifest for your shiny app
f7Login

Provide a template for authentication
class2f7

Get CSS class based on cell class
f7Appbar

Create a Framework 7 appbar
f7BlockFooter

Create a Framework7 block footer
f7Block

Create a Framework7 block
f7Col

Create a Framework7 column container
f7Chip

Create a Framework7 chips
f7Back

Create a framework 7 back button
f7Badge

Create a Framework7 badge
f7HideOnEnable

f7DownloadButton

Create a download button
f7Dialog

Create a Framework7 dialog window
f7HideOnSearch

Utility to hide a given tag on search
f7InsertTab

f7BlockHeader

Create a Framework7 block header
f7AutoComplete

Create a Framework7 autocomplete input
f7Gallery

Launch the shinyMobile Gallery
f7ColorPicker

Create a Framework7 color picker input
f7Padding

Create a Framework7 padding
f7DatePicker

Create a Framework7 date input
f7Notif

Create a Framework7 notification
f7Found

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

Create a fremework7 photo browser
f7Password

Create an f7 password input
f7BlockTitle

Create a Framework7 block title
f7List

Create a framework 7 contact list
f7Item

f7Picker

Create a Framework7 picker input
f7Segment

Create a Framework7 segmented button container
f7Popover

Create a framework 7 popover
f7ListGroup

Create a framework 7 group of contacts
f7Icon

Framework7 icons
f7Gauge

Create a Framework7 gauge
f7Init

Custom initialization
f7HideNavbar

Hide a framework7 navbar
f7ExpandableCard

Create a Framework7 expandable card
f7Messages

Create a Framework7 messages container
f7Select

Create an f7 select input
f7Navbar

Create a Framework7 Navbar
f7Button

Create a Framework7 button
f7Card

Create a Framework7 card
f7ListItem

Create a Framework 7 contact item
f7Margin

Create a Framework7 margin
f7Searchbar

Create a Framework 7 searchbar
f7PanelMenu

Create a Framework7 sidebar menu
f7SearchIgnore

Utility to ignore an item from search.
f7PanelItem

Create a Framework7 sidebar menu item
f7Row

Create a Framework7 row container
f7SearchbarTrigger

Create a Framework 7 searchbar trigger
f7FabClose

f7SingleLayout

Create a Framework7 single layout
f7FabMorphTarget

Convert a tag into a target morphing
f7Shadow

Create a Framework7 shadow effect
f7Fab

Create a Framework7 floating action button (FAB)
f7ProgressInf

Create a Framework7 infinite progress bar
f7Progress

Create a Framework7 progress bar
f7Tabs

Create a Framework7 tabs
f7SplitLayout

Create a Framework7 split layout
f7Float

Create a Framework7 float
f7ShowNavbar

Show a framework7 navbar
f7Flex

Create a Framework7 flex container
f7ListIndexItem

Create a Framework 7 list index item
f7ListIndex

Create a Framework 7 list index
f7Fabs

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

Create a Framework 7 skeleton loading overlay
f7Stepper

Create a F7 radio stepper
f7TabLayout

Create a Framework7 page with tab layout
f7Tab

Create a Framework7 tab item
f7Tooltip

Create a Framework7 tooltip
f7Message

Create a f7Message
f7MessageBar

Create a f7MessageBar to add new messages
f7TapHold

Create a Framework7 tapHold event
f7TabLink

Special button/link to insert in the tabbar
f7Slide

Create a Framework7 slide
f7TogglePopup

f7File

File Upload Control
f7Items

f7Panel

Create a Framework7 panel
f7Radio

Create an f7 radio button input
f7Page

Create a Framework7 page
f7SmartSelect

Create a Framework7 smart select
f7SocialCard

Create a Framework7 social card
f7RemoveTab

f7ValidateInput

Util function to validate a given shinyMobile Input
f7Link

Create a Framework7 link
f7Next

Create a framework 7 next button
f7SwipeoutItem

Create a framework7 swipeout item
f7NotFound

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

Create a f7 slider
f7PopoverTarget

Define a popover target
f7Toggle

Create a F7 toggle switch
f7VirtualListItem

Virtual List item
f7VirtualList

High performance list component
f7Toast

Create a Framework7 toast
updateF7Card

Update a framework 7 expandable card
updateF7Checkbox

Change the value of a checkbox input on the client
f7Toolbar

Create a Framework7 Toolbar
getF7Colors

Function to get all colors available in shinyMobile
f7Table

Table
f7Popup

Create a f7 popup
%>%

Pipe operator
f7Text

Create an f7 text input
f7Swiper

Create a Framework7 swiper
f7TextArea

Create an f7 text area input
updateF7MessageBar

Update message bar on the server side
updateF7Panel

updateF7Accordion

Update a Framework 7 accordion
f7Sheet

Create an f7 sheet modal
updateF7AutoComplete

Change the value of an autocomplete input on the client
updateF7Text

Change the value of a text input on the client
updateF7Tabs

Update a Framework 7 tabsetPanel
updateF7Button

Change the value of a button input on the client
updateF7VirtualList

Update a f7VirtualList on the server side
updateF7Fabs

Toggle f7Fabs on the server side.
updateF7Toggle

Change the value of a toggle input on the client
f7SubNavbar

Create a Framework7 sub navbar
f7ShowPreloader

Show preloader
updateF7Gauge

update a framework7 gauge from the server side
updateF7Select

Change the value of a select input on the client
preview_mobile

Allow to preview a given app on different devices.
f7Swipeout

Create a framework7 swipeout element
f7Timeline

Create a Framework7 timeline
f7checkBox

Create a F7 Checkbox
f7TimelineItem

Create a Framework7 timeline item
updateF7Slider

Change the value of a slider input on the client
updateF7SmartSelect

Change the value of a smart select input on the client
f7checkBoxGroup

Create an f7 checkbox group input
updateF7Stepper

Change the value of a stepper input on the client
updateF7Fab

Change the value of a f7Fab input on the client
updateF7Progress

update a framework7 progress bar from the server side
updateF7Picker

Change the value of a picker input on the client
updateF7DatePicker

Change the value of a date picker input on the client