Reputation: 127
I've built an app with shinydashboard and would like to format correctly some of the input labels. For example, I have a numeric input like this:
numericInput("input_a", "Label (unit = m2)", value = 1)
I cannot find how to edit the m2
to be m²
.
I have tried to use the expression
function, without success:
expression(Label~(unit~=~m^2))
Upvotes: 3
Views: 1847
Reputation: 389175
Here are two option -
tags$sup
library(shiny)
ui <- fluidPage({
fluidRow(
column(6, numericInput("input_a", "Label (unit = m²)", value = 1)),
column(6, numericInput("input_b", HTML(paste0("Label (unit = m",tags$sup("2"), ')')), value = 1))
)
})
server <- function(input, output) {}
shinyApp(ui, server)
Upvotes: 5