Reduce size of Shiny check boxes in a checkboxgroup and radio buttons in a radio button group

I'm just getting started in Shiny and am puzzled by the large sizes of various elements, in this case the size of default fonts and check boxes in a check box group. With an individual check box, I can modify these by preceding the checkboxInput with a tags$style, such as in

                  tags$style("#fieldsPanel {font-size:10px;height:10px;}")
                  checkboxInput(inputId="fieldsPanel", label='Toggle fields table', value=F)

However, this approach doesn't work in a check box (or radio button) group as the height parameter seems to control the height of each item in the group but not the size of the actual check box. Clearly I'm not understanding something. Is there a way to do this? Can anyone shed some light on this?

Hi @dkStevensNZed. Does this get to your desired output?


ui <- fluidPage(
  tags$style("#fieldsPanel {font-size:10px;height:10px;}
             #group input {height:10px;}"
  # single inputs
  checkboxInput(inputId="original", label='Original size', value=F),
  checkboxInput(inputId="fieldsPanel", label='Altered size', value=F),
  # group inputs
  checkboxGroupInput('orig', 'Original size', choices = c('a', 'b'), inline = T),
  checkboxGroupInput('group', 'Altered size', choices = c('a', 'b'), inline = T)

server <- function(input, output) {}

shinyApp(ui, server)


That did the trick! Thanks so much!

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.