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
We could do more to make smarter defaults for this special situation (i.e., a single layout_sidebar() appearing as a direct child of page_fillable()), but even if we do, that may not be good enough for a basic getting started tutorial. Instead of (or addition to) smarter defaults, we may want an higher-order abstraction like:
page_sidebar(
title="My dashboard",
sidebar= sidebar("side"),
fillable=FALSE, # must opt-out of filling layoutplotly::plot_ly()
)
This page_sidebar() API is pretty similar to how we currently recommend you create multi-page sidebar layouts. It might make sense to align these as much as possible (i.e., default to fillable = TRUE for both? Use title instead of header for both?)
page_navbar(
title="My dashboard",
sidebar= sidebar("side"),
fillable=FALSE, # must opt-out of filling layout?
nav_panel("Plot", plotly::plot_ly())
)
Also, once we have navigation in the sidebar (see #585), maybe an API like this could also work (we'd throw if you tried to supply sidebar or non-nav items as children and use navset_sidebar() under-the-hood):
cpsievert
changed the title
Consider adding sidebar argument to all page_*() functions
Make it easier to create single-page dashboard-with-sidebar layouts
May 18, 2023
cpsievert
changed the title
Make it easier to create single-page dashboard-with-sidebar layouts
Easier single-page dashboard-with-sidebar layouts
May 18, 2023
cpsievert
changed the title
Easier single-page dashboard-with-sidebar layouts
Simplify dashboard-like layouts
May 18, 2023
Right now, you'd need something like this for a (single-page) dashboard-like filling layout:
We could do more to make smarter defaults for this special situation (i.e., a single
layout_sidebar()
appearing as a direct child ofpage_fillable()
), but even if we do, that may not be good enough for a basic getting started tutorial. Instead of (or addition to) smarter defaults, we may want an higher-order abstraction like:This
page_sidebar()
API is pretty similar to how we currently recommend you create multi-page sidebar layouts. It might make sense to align these as much as possible (i.e., default tofillable = TRUE
for both? Usetitle
instead ofheader
for both?)Also, once we have navigation in the sidebar (see #585), maybe an API like this could also work (we'd throw if you tried to supply
sidebar
or non-nav items as children and usenavset_sidebar()
under-the-hood):And, in the rare case you wanted both header and sidebar navigation, you'd have to start with
page_navbar()
(this should just fall out of #585):The text was updated successfully, but these errors were encountered: