Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying radio button in elements in Shiny in a horizontal order instead of default vertical view

I'm working on a Shiny app that enables folk to browse some time series data. I have a number of widgets that enable people to select variables and type of analysis. In between, I have a modest radioButton mechanism that allows users to select time series for some variables:

radioButtons("radio_year_select","Year", c("1999" = "1999", "2001" = "2001"))),

The code generates a simple widget:

widget - years

In the context of this particular application, I would like to have the options presented in a horizontal order, like that:

Year:      [X]1999              [   ]2001

Is there a simple way to achieve that?

like image 764
Konrad Avatar asked Aug 12 '15 20:08

Konrad


People also ask

Should radio buttons be horizontal or vertical?

Vertical positioning of radio buttons is safer. Try to lay out your lists vertically, with one choice per line. If you still need a horizontal layout with multiple options per line, make sure to space the buttons and labels so that it's absolutely clear which choice goes with which label.

Can radio buttons be horizontal?

By default, checkboxes and radio buttons are displayed in vertical format. You can change the appearance to be horizontal instead using a Custom CSS Class. The default vertical display is recommended.

How do you make a radio button group horizontal?

How do you make a radio button group horizontal? Drag a radio list widget to your screen, go to the Properties tab and select 'Orientation' -> Horizontal.


1 Answers

Add inline=TRUE

radioButtons("radio_year_select","Year", c("1999" = "1999", "2001" = "2001"), inline=T)
like image 184
Rorschach Avatar answered Sep 28 '22 01:09

Rorschach