Antonio
Antonio

Reputation: 1111

How to insert the up and down arrows in a selectInput

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

Upvotes: 1

Views: 197

Answers (1)

akrun
akrun

Reputation: 887691

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

Upvotes: 2

Related Questions