Positioning Shiny widgets next to headings

How can I place Shiny widgets (e.g. selectInput() ) besides my headers? I played with various recipes tags without any luck. Grateful for any pointers.

ui.R

 library(shiny) pageWithSidebar( headerPanel("side-by-side"), sidebarPanel( tags$head( tags$style(type="text/css", ".control-label {display: inline-block;}"), tags$style(type="text/css", "#options { display: inline-block; }"), tags$style(type="text/css", "select { display: inline-block; }") ), selectInput(inputId = "options", label = "dropdown dox:", choices = list(a = 0, b = 1)) ), mainPanel( h3("bla bla") ) ) 

server.R

 shinyServer(function(input, output) { NULL }) 
+5
source share
1 answer

Is this what you want?

 library(shiny) runApp(list(ui = pageWithSidebar( headerPanel("side-by-side"), sidebarPanel( tags$head( tags$style(type="text/css", "label.control-label, .selectize-control.single{ display: inline-block!important; }") ), selectInput(inputId = "options", label = "dropdown dox:", choices = list(a = 0, b = 1)) ), mainPanel( h3("bla bla") ) ) , server = function(input, output) { NULL }) ) 

enter image description here

+6
source

Source: https://habr.com/ru/post/1208141/


All Articles