I want to use selectInput to set the title on a box. For example, I would like the default title to be: Name 2 settings
Right now, I'm able to get the title to be [1] "Name 2 settings"
. Is there a way to remove the [1]
and the quotes?
Thanks!
This is my sample app:
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(dashboardHeader(),
dashboardSidebar(),
dashboardBody(fluidRow(
box(
title = "Settings", width = 6, solidHeader = TRUE, status = "primary",
flowLayout(selectInput(
"Design", "Design:",
c("Name 1" = "Name 1",
"Name 2" = "Name 2"),
selected = "Name 2"
))
),
box(
title = textOutput("Design"), width = 4, solidHeader = TRUE, status = "primary",
"Box content"
)
)))
server <- function(input, output) {
output$Design <- renderPrint({
paste(input$Design, 'settings')
})
}
shinyApp(ui, server)
Just replace renderPrint
with renderText
:
server <- function(input, output) {
output$Design <- renderText({
paste(input$Design, 'settings')
})
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With