How to use tags$HTML in shiny module

...I am trying to adjust the height and font-size of the value of input element. Below code works without shiny module. But i want it in module. Appreciate for any help!!

Please refer below code

inputV_frameweldmentcalc_UI <- function(id){

ns = NS(id)

fluidPage(
div(
tags$head(
tags$style(HTML(
'#projectname{height: 15px}
#projectname{font-size: 10px}
#truckclass{height: 30px}
#truckclass{font-size: 15px}
#truckcapacity{height: 20px}
#truckcapacity{font-size: 15px}
#requestor{height: 20px}
#requestor{font-size: 15px}
)))),

          fluidRow(column(12,

          fluidRow(column(1,
                          div(style = "height: 20px; font-size: 10px;",
                              textInput(inputId = ns("projectname"),
                                        label = "Project Name",
                                        value = ""))),
                   column(1,
                          div(style = "height: 20px; font-size : 10px;",
                              textInput(inputId = ns("truckclass"),
                                        label = "Class",
                                        value = ""))),
                   column(1,
                          div(style = "height: 20px; font-size : 10px;",
                              textInput(inputId = ns("truckcapacity"),
                                        label = "Truck Capacity",
                                        value = ""))),
                   column(1,
                          div(style = "height: 20px; font-size : 10px;",
                              textInput(inputId = ns("requestor"),
                                        label = "Requestor",
                                        value = "")))
                   ))))
                   }

Your code doesn’t work in a module since all id s are prefixed by the module namespace. For instance id = projectname actually becomes I’d =pouet-projectname if your namespace is pouet. To make it work, you may either prefix all your ids or add the style attribute to your input tags. I would go for the second option.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.