Title: | A Spotlight 'React' Widget for 'shiny' Apps |
---|---|
Description: | Creates a contextual menu that can be triggered with keyboard shortcuts or programmatically. This can replace traditional sidebars or navigation bars, thereby enhancing the user experience with lighter user interfaces. |
Authors: | David Granjon [aut, cre], Adenekan Wonderful [cph] (Scoutbar React library: <https://github.com/adenekan41/scoutbar>) |
Maintainer: | David Granjon <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-11-25 16:33:15 UTC |
Source: | CRAN |
Creates an item that can perform actions on the server side.
scout_action(id, label, description, closeOnClick = TRUE, ...)
scout_action(id, label, description, closeOnClick = TRUE, ...)
id |
Unique id. |
label |
Action label. |
description |
Action description. |
closeOnClick |
Whether to close the scoutbar whenever this action is clicked. Default to TRUE. |
... |
Other options. See https://www.scoutbar.co/docs/actions. |
This function is meant to be embeded directly within scoutbar or via a more structured way within scout_page or scout_section. It serves as a bridge between R and JavaScript to communicate with the Scoutbar React API, so you are not expected to call it on its own.
A list containing:
children: a sublist where are passed the options.
class: a character vector to identify the action on the JavaScript side. You are not expected to modify it as it will break the JavaScript binding.
Can embed scout_action on a separate view of the Scoutbar.
scout_page(label, ..., .list = NULL)
scout_page(label, ..., .list = NULL)
label |
Page label. |
... |
Expect scout_action. |
.list |
To programmatically pass a list of scout_action,
with |
Whenever many scout_action share a similar topic, or have nested topics, this function allows you to provide a better experience by isolating some actions in a separate view. You can nest pages within other pages and combine it with scout_section.
A list containing:
children: a sublist where are passed the scout_action.
label: The page label.
class: a character vector to identify the page on the JavaScript side. You are not expected to modify it as it will break the JavaScript binding.
Sort scout_action on the same view.
scout_section(label, ..., .list = NULL)
scout_section(label, ..., .list = NULL)
label |
Section label. |
... |
Expect scout_action. |
.list |
To programmatically pass a list of scout_action,
with |
Whenever many scout_action share a similar topic, you may use this function to sort them in the UI and offer a better user experience. You can combine it with scout_page.
A list containing:
children: a sublist where are passed the scout_action.
label: The section label.
class: a character vector to identify the section on the JavaScript side. You are not expected to modify it as it will break the JavaScript binding.
Scoutbar react widget for Shiny.
Use this function from the server side of your Shiny app to update a scoutbar.
scoutbar( inputId, theme = c("light", "dark", "auto"), placeholder = list("Hello", "Type some text"), actions = list(), ... ) update_scoutbar(session = shiny::getDefaultReactiveDomain(), inputId, ...)
scoutbar( inputId, theme = c("light", "dark", "auto"), placeholder = list("Hello", "Type some text"), actions = list(), ... ) update_scoutbar(session = shiny::getDefaultReactiveDomain(), inputId, ...)
inputId |
Widget input id. |
theme |
Scoutbar theme. |
placeholder |
Scoutbar placeholder text. A string or a list of strings. |
actions |
Scoutbar actions. Expect scout_action or scout_section and scout_page. scout_action can be nested inside scout_section and scout_page. |
... |
Scoutbar configuration. Expect a list of properties like in scoutbar. See possible values here at https://www.scoutbar.co/docs/features. |
session |
Shiny session object. |
Provides a contextual menu users can activate with keyboard shortcut or prommatically with update_scoutbar. Scoutbar may be seen as an alternative to sidebars and navbars, as it allows to construct better navigation menus.
A list of shiny tags containing all the web dependencies and scoutbar elements required to instantiate the Scoutbar React widget from JavaScript.
This function is called for its side effect. It sends a message to JavaScript through the current websocket connection, leveraging the shiny session object.