Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a secondary (right) sidebar to the FastListTemplate #7774

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dalthviz
Copy link

Hi, this PR attempts to add a secondary sidebar (on the right) to the FastListTemplate. This new sidebar works in a similar manner than the existing sidebar including variables/params to handle:

  • Sidebar elements list: right_sidebar
  • Sidebar width: right_sidebar_width
  • Sidebar initial collapsed state: collapsed_right_sidebar
  • Sidebar footer: right_sidebar_footer

Also added a simple test to check the new sidebar and updated the notebook related with the FastListTemplate to include the new variables/params.

Let me know if something else needs to be done!

A preview:

import panel as pn

pn.extension(sizing_mode="stretch_width")

CSS = """
div.card-margin:nth-child(1) {
    max-height: 300px;
}
div.card-margin:nth-child(2) {
    max-height: 400px;
}
"""

title = pn.pane.Markdown("# **Title**")
layout0 = pn.Column(
    pn.pane.Markdown("Content", styles={"color": "white"}),
    pn.VSpacer(),
    styles={"background": "blue"}, sizing_mode="stretch_both"
)

layout1 = pn.Column(styles={"background": "green"}, sizing_mode="stretch_both")
layout2 = pn.Column(styles={"background": "red"}, sizing_mode="stretch_both")
secondary_title = pn.pane.Markdown("# **Secondary title**")
layout3 = pn.Column(
    pn.pane.Markdown("Secondary Content"),
    pn.VSpacer(),
    styles={"background": "yellow"}, sizing_mode="stretch_both"
)

pn.template.FastListTemplate(
    site="Panel",
    title="App",
    sidebar=[title, layout0], 
    right_sidebar=[secondary_title, layout3],
    main=[layout1, layout2],
    raw_css=[CSS],
    sidebar_footer="<b>Footer</b>",
    right_sidebar_footer="<b>Secondary Footer</b>",
).servable()

panel_right_sidebar

Fixes #7696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addition of a collapsible right sidebar to FastListTemplate
1 participant