Shiny 0.8.0
Breaking Changes
-
Page-level sidebars used in
ui.page_sidebar()andui.page_navbar()will now default to being initially open but collapsible on desktop devices and always open on mobile devices. You can adjust this default choice by settingui.sidebar(open=). (#1129) -
ui.sidebar()is now a thin wrapper for the internalui.Sidebarclass. Theui.Sidebarclass has been updated to store the sidebar's contents and settings and to delay rendering until the sidebar HTML is actually used. Because most users callui.sidebar()instead of using the class directly, this change is not expected to affect many apps. (#1129)
New features
-
Added
ui.input_dark_mode(), a toggle switch that allows users to switch between light and dark mode. By default, whenui.input_dark_mode()is added to an app, the app's color mode follows the users's system preferences, unless the app author sets themodeargument. Whenui.input_dark_mode(id=)is set, the color mode is reported to the server, and server-side color mode updating is possible usingui.update_dark_mode(). (#1149) -
ui.sidebar(open=)now accepts a dictionary with keysdesktopandmobile, allowing you to independently control the initial state of the sidebar at desktop and mobile screen sizes. (#1129) -
Closed #984: In Shiny Express apps, if there is a
"www"subdirectory in the app's directory, Shiny will serve the files in that directory as static assets, mounted at/. (#1170) -
For Shiny Express apps, added
express.app_opts(), which allows setting application-level options, likestatic_assetsanddebug. (#1170) -
Closed #1079: For Shiny Express apps, automatically run a
globals.pyfile in the same directory as the app file, if it exists. The code inglobals.pywill be run with the session context set toNone. (#1172)
Other changes
-
@render.data_framenow properly fills its container by default. (#1126) -
We improved the accessibility of the full screen toggle button in cards created with
ui.card(full_screen=True). Full-screen cards are now also supported on mobile devices. (#1129) -
When entering and exiting full-screen card mode, Shiny now emits a client-side custom
bslib.cardevent that JavaScript-oriented users can use to react to the full screen state change. (#1129) -
The sidebar's collapse toggle now has a high
z-indexvalue to ensure it always appears above elements in the main content area ofui.layout_sidebar(). The sidebar overlay also now receives the same highz-indexon mobile layouts. (#1129) -
Updated example apps to use lower-case versions of
reactive.Calc->reactive.calc,reactive.Effect->reactive.effect, andreactive.Value->reactive.value. (#1164) -
Closed #1081: The
@expressify()function now has an optionhas_docstring. This allows the decorator to be used with functions that contain a docstring. (#1163)
Bug fixes
-
Fixed
input_task_buttonnot working in a Shiny module. (#1108) -
Fixed several issues with
page_navbar()styling. (#1124) -
Fixed
Renderer.output_idto not contain the module namespace prefix, only the output id. (#1130) -
Fixed gap-driven spacing between children in fillable
nav_panel()containers. (#1152) -
Fixed #1138: An empty value in a date or date range input would cause an error; now it is treated as
None. (#1139)