Appsilon / semantic.dashboard

Quick, beautiful and customizable dashboard template for Shiny based on shiny.semantic and Fomantic UI.
https://appsilon.github.io/semantic.dashboard/
Other
255 stars 44 forks source link

[Feature]: Ability to conditionally hide/show tabs based on user inputs #188

Open AlexPars opened 2 years ago

AlexPars commented 2 years ago

Guidelines

Description

combination of semantic.dashboard + shiny.semantic delivers very powerful Shiny dashboards.

Tabs created are sidebar tabs (for example, using semantic.dashboard::dashboardSidebar and semantic.dashboard::sidebarMenu and semantic.dashboard::menuItem) and top bars (for example, using semantic.dashboard::tabBox and semantic.dashboard::box)

It would be very useful to be able to conditionally hide/show tabs (both on sidebar and on panels) based on user inputs

Problem

It allows tabs to be added/removed dynamically

Proposed Solution

I do not know.

I have seen approaches such as: https://shiny.rstudio.com/reference/shiny/latest/showTab.html https://deanattali.com/blog/advanced-shiny-tips/#hide-tab https://stackoverflow.com/questions/33027756/hide-an-element-box-tabs-in-shiny-dashboard https://rdrr.io/cran/fomantic.plus/man/tab_visibility.html https://stackoverflow.com/questions/70085846/how-i-can-hide-a-tab-with-shinyjs

Alternatives Considered

I have tried approaches mentioned above

osenan commented 2 years ago

If you provide the id of the component you want to hide, for example with shinyjs::hide you should be able to hide and element and show it again with shinyjs::show. Only if a component does not have id we would need a different solution and maybe we would need to develop a new feature to include the id. I will change the category as a question. I will do some research on the cases you mention and if with any case there is not a simple JS solution I will create an issue for it.