R Shiny add separator into radio button list choices -


i've kind of radio button :

             radiobuttons("test", "test:",                           c("def" = "def",                           "ghi" = "ghi",                             "jkl" = "jkl") 

but add separator tag$hrto separate def others. tried make 2 list :

radiobuttons("test", "test:", c("def" = "def"), tag$hr , radiobuttons("test", "test:", c("ghi" = "ghi", "jkl" = "jkl") 

but doesn't work.

thanks !

in experience shiny app development have found "inspect source" function of modern browsers incredibly powerful. lets see html/css/js behind websites , can use model work off. shiny lets insert html/css directly app. running radiobuttons command supplied, using developer feature of chrome, able see exact html built radiobuttons. can insert hr directly between options. added new hr class called radio in head because default hr has bit of padding around , similar grey input box. might want able use regular hr elsewhere in app.

there might simpler way bit more of html/css pro speak to. hope helps.

library(shiny)   ui <- fluidpage(      tags$head(           tags$style(html(                "hr.radio {                     border: 0;                     border-top: 1px solid #8c8b8b;                     padding-top: 1;                }"           ))      ),      titlepanel("new radio button style"),      sidebarlayout(       sidebarpanel(html(" <div id='test' class='form-group shiny-input-radiogroup shiny-input-container shiny-bound-input'>      <label class='control-label' for='test'>test</label> <div class='shiny-options-group'>      <div class='radio'>           <label>                <input type='radio' name='test' value='one' checked='checked'>                <span>one</span>           </label>      </div>      <hr class ='radio'>      <div class='radio'>           <label>                <input type='radio' name='test' value='two'>                <span>two</span>           </label>      </div>      <hr class = 'radio'>      <div class='radio'>           <label>                <input type='radio' name='test' value='three'>                <span>three</span>           </label>      </div> </div> </div>")        ),        # can see input$test still reacting radiobuttons       mainpanel(          textoutput("selection")       )    ) )   server <- function(input, output) {     output$selection <- rendertext({       input$test    }) }   shinyapp(ui = ui, server = server) 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -