Designsystemet components for Shiny
Overview
shinyds lets you build Norwegian public sector Shiny applications that follow Designsystemet — the shared design system for Norwegian government services. Components are accessible, consistently styled, and work with input$id just like native Shiny inputs.
Installation
From CRAN
install.packages("shinyds")Which version to install
GitHub releases follow Designsystemet: a new shinyds release is published on GitHub shortly after each upstream release. The CRAN policy asks for updates no more than every 1–2 months, so only releases with breaking changes are submitted to CRAN. Install from GitHub to get the latest Designsystemet version.
Quick start
library(shiny)
library(bslib)
library(shinyds)
ui <- bslib::page_fluid(
use_designsystemet(),
ds_heading("Hello Designsystemet!", level = 1),
ds_field(
ds_label("Your name", `for` = "name"),
ds_input("name", placeholder = "Enter your name")
),
ds_button("Greet", inputId = "btn", variant = "primary"),
uiOutput("greeting")
)
server <- function(input, output, session) {
output$greeting <- renderUI({
req(input$btn, input$name)
ds_alert(paste("Hello,", input$name), variant = "success")
})
}
shinyApp(ui, server)Getting help
shinyds specific questions can be posted to the GitHub Discussions.
The broader Designsystemet community has a Slack channel.