Closed nstrayer closed 8 months ago
Name | Link |
---|---|
Latest commit | 833e1d808986c261757b4c8512a4bccc28c483d1 |
Latest deploy log | https://app.netlify.com/sites/shinyuieditor-storybook/deploys/6527f7e6de89590008455de0 |
Here's what a sample app looks like:
From code:
library(shiny)
library(bslib)
library(ggplot2)
# install.packages("palmerpenguins")
data(penguins, package = "palmerpenguins")
ui <- page_navbar(
title = "Penguins dashboard",
sidebar = sidebar(
title = "Sidebar Title",
selectInput(
selected = "species",
inputId = "color_by",
label = "Color by",
choices = list(
"species" = "species",
"island" = "island",
"sex" = "sex"
)
),
),
nav_panel(
title = "Bill Length",
card(
full_screen = TRUE,
card_header("Bill Length"),
plotOutput(outputId = "bill_length")
)
),
nav_panel(
title = "Bill Depth",
card(
full_screen = TRUE,
card_header("Bill depth"),
card_body(),
plotOutput(outputId = "bill_depth")
)
),
nav_panel(
title = "Body Mass",
card(
full_screen = TRUE,
card_header("Body Mass"),
plotOutput(outputId = "body_mass")
)
)
)
server <- function(input, output) {
gg_plot <- reactive({
ggplot(penguins) +
geom_density(aes(fill = !!input$color_by), alpha = 0.2) +
theme_bw(base_size = 16) +
theme(axis.title = element_blank())
})
output$bill_length <- renderPlot(gg_plot() + aes(bill_length_mm))
output$bill_depth <- renderPlot(gg_plot() + aes(bill_depth_mm))
output$body_mass <- renderPlot(gg_plot() + aes(body_mass_g))
}
shinyApp(ui, server)
/update-snapshots
This PR adds support for the newer
nav_panel
function to make tabs. The oldtabPanel()
support has been moved into an alias fornav_panel()
which will result in an automatic updating of code tonav_panel()
.