如何使闪亮小部件的标签与纯文本相同?

How to make a label of a shiny widget the same as plain text?

在下面的例子中,我有一个数字输入。标签的字体类型为粗体(见图)。怎样才能让标签的字体和纯文本一样,就像“这里有一些文字”中的那样?

library(shiny)

ui <- fluidPage(
  br(),
  "Here are some texts",
  br(),
  numericInput(inputId = "num1",
               label = "This is a numeric input",
               value = NA)
)

server <- function(input, output){
  
}

shinyApp(ui, server)

将此行添加到您的 ui 将从标签中删除粗体:

tags$head(tags$style(HTML("label {font-weight:normal;}"))),


已添加,我们可以将其包裹在div中并给它一个class:

tags$head(tags$style(HTML(".not_bold label {font-weight:normal;}"))),
    div(numericInput(inputId = "num1",
                 label = "This is a numeric input",
                 value = NA),class="not_bold")  
    ,numericInput(inputId = "num2",
                 label = "This is a numeric input too",
                 value = NA)