This repository provides a structured template for building institutional Shiny dashboards with consistent layout, branding, and legal footer.
UI stands for User Interface. A Shiny application usually consists of two main components: a ui object and a server function.
- The UI defines what the user sees (layout, inputs, outputs).
- The server defines how the application behaves (reactivity, data processing, rendering).
If you are new to Shiny, see the official Shiny getting started tutorial to learn the basics.
- Clone or copy this repository.
- Open
config.ymland set your title, brand, and legal notice. - Open
dashboard_ui.Rand add your UI elements insidedashboard_ui(). - Open
dashboard_server.Rand add your server logic insidedashboard_server(). - Run the app:
shiny::runApp()That's it. You do not need to touch any other file.
app.R # Application entry point (do not modify)
template/
layout.R # Layout helpers (do not modify)
dashboard_ui.R # Edit this – dashboard UI content
dashboard_server.R # Edit this – dashboard server logic
config.yml # Branding and legal configuration
write_manifest.R # Run once before deploying to Posit Connect
www/
style.css # Styling
logo-standard.png
logo-black.png
Edit dashboard_ui.R and define:
dashboard_ui <- function() {
tagList(
# your UI components here
)
}Edit dashboard_server.R and define:
dashboard_server <- function(input, output, session) {
# your server logic here
}Load static datasets at the top of dashboard_server.R, above the
dashboard_server() function. Use reactive() only if data must update during runtime.
Edit config.yml:
title: "Dashboard title"
brand: "standard" # or "black"
legal_notice:
- "Institution"
- "Department"
- "Contact"brandcontrols the logo and footer color.legal_noticeitems are displayed in the footer separated by dots.partner_logosshould be prepared in1500 x 850 px(about1.76:1), and the template scales them into a consistent display frame.
The template ships with English/German support via shiny.i18n. You don't need to use it — if you only need one language, just write plain strings.
To make a string translatable:
- Add a row to
www/i18n/translation.json:
{"en": "My label", "de": "Meine Beschriftung"}- Wrap the string with
tr()indashboard_ui.R:
p(tr("My label"))tr() is available inside dashboard_ui() — it translates when a language is selected and falls back to the raw string otherwise.
app.Rtemplate/layout.R
These files define the structural template and should remain unchanged.
In R:
shiny::runApp()Or open app.R in RStudio and click Run App.