Home > OS >  How to insert the up and down arrows in a selectInput
How to insert the up and down arrows in a selectInput

Time:03-14

I would like to insert the up and down arrows next to the Maximize and Minimize options in choices. So I would like to leave it as follows:

Maximize ↑

Minimize ↓

library(shiny)

ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      fluidRow(
       column(
          width = 6,
          selectInput("maxmin", label = h5("Maximize or Minimize"),
choices = list("Maximize " = 1, "Minimize" = 2), selected = "")
        )
      )),
      
    mainPanel(
      
    ))
  
)

server <- function(input, output, session) {
  
}

shinyApp(ui = ui, server = server)

enter image description here

CodePudding user response:

We could use unicode

ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      fluidRow(
        column(
          width = 6,
          selectInput("maxmin", label = h5("Maximize or Minimize"),
                      choices = list("Maximize \u2191" = 1, "Minimize \u2193" = 2), selected = "")
        )
      )),
    
    mainPanel(
      
    ))
  
)

-testing

enter image description here

  • Related