You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I am currently using Shiny for Python to design an application that dynamically creates and removes tabs with the press of an input_task_button. When clicking on the newly generated tab, the intent is to switch to that tab and generate more UI content based on what the user selects in an accordion_panel. I haven't gotten to that part yet but my code is outlined below
fromshinyimportApp, Inputs, Outputs, Session, reactive, render, uifromshinywidgetsimportoutput_widget, render_widgetapp_ui=ui.page_fluid(
ui.navset_tab(
ui.nav_panel("Home",
ui.card(
ui.card_header("Overview"),
ui.p("This is the landing page"),
ui.input_task_button(id="create_tab",
label="Create New Tab",
width="400px",
type="success"),
)
)
id="shiny_tabs"
)
)
defserver(input, output, session):
# Set reactive valuestabs_created=reactive.value(1)
# Generate tabs@reactive.Effect@reactive.event(input.create_tab)def_():
tab_title=f"View {tabs_created.get()}"ui.insert_ui(
ui.navset_tab(
ui.nav_panel(tab_title,
ui.modal("This will include the accordion content")
)
),
selector="#shiny_tabs",
where="beforeEnd"
)
tabs_created.set(tabs_created.get() +1)
app=App(app_ui, server)
The text was updated successfully, but these errors were encountered:
Hello! I am currently using Shiny for Python to design an application that dynamically creates and removes tabs with the press of an input_task_button. When clicking on the newly generated tab, the intent is to switch to that tab and generate more UI content based on what the user selects in an accordion_panel. I haven't gotten to that part yet but my code is outlined below
The text was updated successfully, but these errors were encountered: