shinysnap (development version)
Documentation
- The README, changelog, vignettes,
AGENTS.md, andDESIGN.mdnow use plainer language, shorter sentences, and clearer explanations (#8).
shinysnap 0.1.0
CRAN release: 2026-09-28
Snapshots
-
snap_take()saves the inputs currently on the page, thereactiveValuesregistered withsnap_track(), and any values added bysnap_on_save()hooks. It leaves out inputs whose UI has been removed, action buttons, passwords, and values that Shiny marks as unserializable. It also respectssetBookmarkExclude()and the selection rules insnap_enable(),snap_exclude(), andsnap_include(). - Snapshots are lists of class
shinysnap. Usesnap_inputs(),snap_values(), andsnap_meta()to inspect them, andsnap_diff()to compare them.
Files
- Snapshots use JSON, with enough digits to preserve numeric values and extra type information for values such as dates and matrices. A consistent layout makes changes easy to review in version control.
snap_serialize()andsnap_unserialize()convert snapshots to and from JSON text;snap_write()andsnap_read()write and read files. -
snap_write(format = "zip")creates a bundle that includes uploaded files. Withunsupported = "rds", it can also store R objects that the JSON format does not support. Bundles are checked before extraction. Reading embedded R objects or.rdsfiles requirestrust = TRUE. -
snap_download_button(),snap_download_handler(),snap_file_input(), andsnap_file_restore()add controls for downloading and uploading snapshot files.
Restore
-
snap_restore()restores a snapshot in the current session. It restores tracked values, runssnap_on_restore()hooks, and sends the input values to the browser. Each input receives its value as soon as it is on the page. Shiny’srestoreInput()supplies saved values to dynamic inputs as they are created. Starting another restore cancels the first. - The restore report lists every input as
applied,constructed,reapplied,missing,failed,mismatched, orskipped.snap_on_restored()runs code when the restore finishes, andsnap_is_restoring()tells you whether a restore is in progress. -
snap_restorer()registers a function that converts a saved value into the message an input expects. You can register it for a binding name or an input id. shinysnap includes restorers for shiny, bslib, and shinyMatrix. Usewindow.shinysnap.registerAdapter()to convert messages in JavaScript.
Interoperability
-
snap_as_bookmark_url()turns a snapshot into a Shiny bookmark URL. -
snap_as_test_inputs()prepares saved inputs forshiny::testServer(). -
snap_attachment()returns paths to the files stored in a bundle.
