r - How to place buttons in Shiny -
i building shiny app tabsetpanel 3 tabs (tab1, tab2, , tab3). have 2 action buttons apply of tabs don't want action button inside tabs, them to far right of tabs matter tab in, can see action buttons always. here code talking about:
tabsetpanel( tabpanel( title = "tab1" ) tabpanel( title = "tab2" ) tabpanel( title = "tab3" ) ) and want these 2 action buttons far right of tabs outside of tabsetpanel.
actionbutton('load_inputs', 'load inputs') actionbutton('save_inputs', 'save inputs') it nice if there way within actionbutton() function specify want buttons appear.
you can define location of element using css. add style each button adding attribute style: actionbutton(style= "..."). create .css file custom styles. case set style div buttons are.
below basic example of adding 2 buttons right corner of tabsetpanel.
library(shiny) ui <- fluidpage( titlepanel("tabsets"), div(style = "position:absolute;right:1em;", actionbutton('load_inputs', 'load inputs'), actionbutton('save_inputs', 'save inputs') ), tabsetpanel( tabpanel("tab1", h2("content 1")), tabpanel("tab2", h2("content 2")), tabpanel("tab3", h2("content 3")) ) ) server <- function(input, output, session) { } runapp(list(ui = ui, server = server))
Comments
Post a Comment