Justin
Justin

Reputation: 153

Change Font Size in R Shiny Input Options (shinyjqui)

I'm trying to make the font size of the words on each button to be smaller (which would hopefully also shrink the overall button size for each option) but am struggling to find the right place to write the style = 'font-size: 5px' code. Where would I add that?

library(shiny)
library(shinyjqui)

server <- function(input, output) {
  output$order <- renderPrint({ print(input$dest) })
}

ui <- fluidPage(
  orderInput('source', 'Source', items = month.abb,
             as_source = TRUE, connect = 'dest'),
  orderInput('dest', 'Dest', items = NULL, placeholder = 'Drag items here...'),
  verbatimTextOutput('order')
)

shinyApp(ui, server)

Upvotes: 1

Views: 716

Answers (1)

lz100
lz100

Reputation: 7340

library(shiny)
library(shinyjqui)

server <- function(input, output) {
    output$order <- renderPrint({ print(input$dest) })
}

ui <- fluidPage(
    orderInput('source', 'Source', items = month.abb,
               as_source = TRUE, connect = 'dest'),
    orderInput('dest', 'Dest', items = NULL, placeholder = 'Drag items here...'),
    verbatimTextOutput('order'),
    tags$style(HTML(
        '
        .btn.shinyjqui {font-size: 5px}
        '
    ))
)

shinyApp(ui, server)

enter image description here

to also shrink the button

    tags$style(HTML(
        '
        .btn.shinyjqui {
            font-size: 5px;
            padding: 0;
        }
        
        '
    ))

enter image description here

Upvotes: 1

Related Questions