tests/testthat/auto_theme_shiny/base/app.R

library(shiny)
library(thematic)

thematic_shiny(font = "auto")

ui <- fluidPage(
  titlePanel("Hello"),
  tags$head(
    tags$link(href="https://fonts.googleapis.com/css?family=Pacifico", rel="stylesheet"),
    tags$style(HTML("body{background-color:#444444; color:#e4e4e4; font-family: Pacifico}")),
    tags$style(HTML("a{color:#e39777}"))
  ),
  plotOutput("p")
)

render_plot <- function(expr) {
  snapshotPreprocessOutput(renderPlot(expr), function(value) {})
}

server <- function(input, output, session) {
  output$p <- render_plot({
    plot(1:5, col = 1:5)
  })
}

shinyApp(ui, server)

Try the thematic package in your browser

Any scripts or data that you put into this service are public.

thematic documentation built on Nov. 4, 2023, 9:07 a.m.