How to hide/show tabs in shiny app in R?

0 votes
How to hide/show tabs in shiny app in R?

Is there a way to show tabs only when (input == "") condition.

I have tabs for each category. Can i show specific category tab depending on selection of tabs?
Aug 21, 2019 in Data Analytics by radha
1,447 views

1 answer to this question.

0 votes

Hi, Radha

One way is to use hidetab and showtab by providing is to tabPanel, navlistPanel, etc inside the shiny app to hide tabs within tablistpanel or navlistpanel.

Syntax: 

showTab(inputId, target, select = FALSE, session = getDefaultReactiveDomain())

hideTab(inputId, target, session = getDefaultReactiveDomain())

Here InputId is the id of tablistPanel or navlist panel, etc. whereas the target is the tabs panel which needs to be hidden in the shiny app.

Use hideTab(id) after checking condition using reactive value or input$input_id.

#example if(input$sales >20000){ hideTab(id,target = [tabpanel id]) }
answered Aug 21, 2019 by anonymous
• 32,460 points

See the documentation for more information on hidetab and show tab here.

https://shiny.rstudio.com/reference/shiny/1.2.0/showTab.html

Related Questions In Data Analytics

0 votes
1 answer

How to reduce the height of valueBox in shiny R?

Add this line before using your vlaueBoxes tags$head(tags$style(HTML(".small-box ...READ MORE

answered Dec 4, 2018 in Data Analytics by Haseeb
1,380 views
0 votes
1 answer

How to add videos in a shiny R dashboard?

Its pretty simple, try this: server.r library(shiny) shinyServer(function(input, output, session) ...READ MORE

answered Dec 4, 2018 in Data Analytics by Haseeb
790 views
0 votes
2 answers

How to add sliderbars in a shiny R dashboard?

To add slider bar and slider range ...READ MORE

answered Dec 4, 2018 in Data Analytics by Kalgi
• 51,890 points
251 views
0 votes
0 answers

How to normalize values in fields to show in plots in R?

Hi, I use a dataset called airquality ...READ MORE

Jul 9, 2019 in Data Analytics by sindhu
81 views
0 votes
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,820 points
851 views
0 votes
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,820 points
610 views
0 votes
1 answer

How to include css code in shiny r app?

To include a CSS file, use includeCSS(), ...READ MORE

answered Aug 30, 2019 in Data Analytics by anonymous
• 32,460 points
728 views
0 votes
1 answer

How to format output in shiny app?

You can use sprintf() to define the ...READ MORE

answered Aug 20, 2019 in Data Analytics by anonymous
• 32,460 points
128 views