NOTE: This package is under heavy development and the APIs are expected to change. So proceed with extreme caution!
Satin is an R package that provides a highly opinionated way to organize large, multi-page shiny apps. It allows users to focus on building independent modules for each page following a minimal set of conventions, and relegating all the boilerplate code involding in laying them out in the dashboard to a simple YAML configuration file.
You can install
satin from github:
Satin ships with two useful snippets
stcomponent that lets you create
component modules that follow the conventions. You can install it by running
st_add_snippets. Note that you will need to restart RStudio for the snippets to be usable.
You can easily scaffold a
satin dashboard app using the
New Project menu in
A module referred to as
fooneeds to specify the following functions:
The layout for the dashboard is specified in YAML.
menuitem becomes a menu item in the sidebar.
- If a
menuitem has more than 1 child, the children become subitems.
- If the child of a
menuitem has a
tabsitem, they are rendered as a
- Each item (page) is connected to a module by its name.
name: Main Dashboard sidebar: - text: Finance icon: briefcase menu: - text: Registrations module: registrations - text: Subscriptions tabs: - text: Individual module: subscribers_individual - text: Group module: subscribers_group - text: People icon: user menu: - text: People tabs: - text: Team Size module: team_size - text: Organogram module: organogram
- Each page is independently developed as a standalone module.
- Use the function
preview_moduleto preview the module.
- Add it to the dashboard by editing
- Hook up passing of data to each module
- Wrap all utilities into a package
- Automatically check if tabnames are unique
- Allow factory modules that can accept static parameters
- Fix bugs where when menu item has only one child, tabNames have to be same.
- Allow deep linking at the tab level (by default)