如何在 selectInput 中插入上下箭头

How to insert the up and down arrows in a selectInput

我想在 choices 中的 MaximizeMinimize 选项旁边插入上下箭头。所以我想保留如下:

最大化↑

最小化↓

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)

我们可以使用 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(
      
    ))
  
)

-测试