Skip to content

I want a layout with 2 sidebars (one left, one right) #1350

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

Closed
sidviny opened this issue May 3, 2024 · 2 comments
Closed

I want a layout with 2 sidebars (one left, one right) #1350

sidviny opened this issue May 3, 2024 · 2 comments

Comments

@sidviny
Copy link

sidviny commented May 3, 2024

Hi,

I would like to get a layout with 2 sidebars, one on the left, one on the right. The center would be the real page data.

I can't seem to do it, maybe because I still haven't figured out how to use all the elements. Best I had, was a left sidebar, content split and in that one a right sidebar. But the margins and/or paddings were not correct and I have whitespace around the right sidebar

@cpsievert
Copy link
Collaborator

Here's an example of how todo this in R, and here is the Python equivalent:

from shiny import App, ui

app_ui = ui.page_fillable(
  ui.h1("Left and right sidebar", class_ = "px-3 my-3"),
  ui.layout_sidebar(
    ui.sidebar("Left sidebar"),
    ui.layout_sidebar(
        ui.sidebar("Right sidebar", position = "right", open = 'closed'),
        "Main contents",
        border = False
    ),
    border_radius = False,
    fillable = True,
    class_ = "p-0"
  )
)

def server(input):
    pass

app = App(app_ui, None)

@sidviny
Copy link
Author

sidviny commented May 3, 2024

Thank you !

Seems the extra class_ stuff solves the problem.

@sidviny sidviny closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants