diff --git a/CHANGELOG.md b/CHANGELOG.md index d6062841b..3f36748f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Other changes +* Documentation updates. (#591) * Removed Python 3.7 support. (#590) diff --git a/shiny/experimental/examples/input_text_area/app.py b/shiny/experimental/examples/input_text_area/app.py new file mode 100644 index 000000000..b18010e56 --- /dev/null +++ b/shiny/experimental/examples/input_text_area/app.py @@ -0,0 +1,17 @@ +import shiny.experimental as x +from shiny import App, Inputs, Outputs, Session, render, ui + +app_ui = ui.page_fluid( + x.ui.input_text_area("caption", "Caption:", "Data summary", autoresize=True), + ui.output_text_verbatim("value"), +) + + +def server(input: Inputs, output: Outputs, session: Session): + @output + @render.text + def value(): + return input.caption() + + +app = App(app_ui, server) diff --git a/shiny/experimental/ui/_accordion.py b/shiny/experimental/ui/_accordion.py index 246d771a6..6bf67196f 100644 --- a/shiny/experimental/ui/_accordion.py +++ b/shiny/experimental/ui/_accordion.py @@ -36,11 +36,11 @@ class AccordionPanel: ---------- *args Contents to the accordion panel body. Or tag attributes that are supplied to the - returned `Tag` object. + returned :class:`~htmltools.Tag` object. data_value A character string that uniquely identifies this panel. icon - A `Tag` which is positioned just before the `title`. + A :class:`~htmltools.Tag` which is positioned just before the `title`. title A title to appear in the :func:`~shiny.experimental.ui.accordion_panel`'s header. id @@ -90,12 +90,14 @@ def __init__( def resolve(self) -> Tag: """ - Resolve the `AccordionPanel` into a `Tag`. + Resolve the :class:`~shiny.experimental.ui.AccordionPanel` into a + :class:`~htmltools.Tag`. Returns ------- : - A `Tag` object representing the `AccordionPanel`. + A :class:`~htmltools.Tag` object representing the + :class:`~shiny.experimental.ui.AccordionPanel`. """ btn_attrs = {} if self._is_open: @@ -150,7 +152,8 @@ def resolve(self) -> Tag: def tagify(self) -> Tag: """ - Resolve the `AccordionPanel` into a `Tag`. + Resolve the :class:`~shiny.experimental.ui.AccordionPanel` into a + :class:`~htmltools.Tag`. Returns ------- @@ -177,9 +180,9 @@ def accordion( Parameters ---------- *args - `~shiny.experimental.ui.AccordionPanel` objects returned from + :class:`~shiny.experimental.ui.AccordionPanel` objects returned from :func:`~shiny.experimental.ui.accordion_panel`. Or tag attributes that are - supplied to the returned `Tag` object. + supplied to the returned :class:`~htmltools.Tag` object. id If provided, you can use `input.id()` in your server logic to determine which of the :func:`~shiny.experimental.ui.accordion_panel`s are currently active. The @@ -300,12 +303,12 @@ def accordion_panel( A title to appear in the :func:`~shiny.experimental.ui.accordion_panel`'s header. *args Contents to the accordion panel body. Or tag attributes that are supplied to the - returned `Tag` object. + returned :class:`~htmltools.Tag` object. value A character string that uniquely identifies this panel. If `MISSING`, the `title` will be used. icon - A `Tag` which is positioned just before the `title`. + A :class:`~htmltools.Tag` which is positioned just before the `title`. **kwargs Tag attributes to the `accordion-body` div Tag. @@ -393,8 +396,8 @@ def accordion_panel_set( """ Dynamically set accordions panel state - Dynamically (i.e., programmatically) update/modify :func:~`shiny.experimental.ui.accordion`s in a Shiny app. - These functions require an `id` to be provided to the :func:~`shiny.experimental.ui.accordion` and must also be + Dynamically (i.e., programmatically) update/modify :func:`~shiny.experimental.ui.accordion`s in a Shiny app. + These functions require an `id` to be provided to the :func:`~shiny.experimental.ui.accordion` and must also be called within an active Shiny session. Parameters @@ -469,7 +472,7 @@ def accordion_panel_close( session: Optional[Session] = None, ) -> None: """ - Close a set of [accordion_panel()]s. + Close a set of accordion panels in an :func:`~shiny.experimental.ui.accordion`. Parameters ---------- @@ -620,7 +623,7 @@ def update_accordion_panel( """ Dynamically update accordions panel contents - Dynamically (i.e., programmatically) update/modify `accordion_panels()`s in a Shiny app. + Dynamically (i.e., programmatically) update/modify :func:`~shiny.experimental.ui.accordion` panels in a Shiny app. These functions require an `id` to be provided to the :func:`~shiny.experimental.ui.accordion` and must also be called within an active Shiny session. diff --git a/shiny/experimental/ui/_card.py b/shiny/experimental/ui/_card.py index d6e00640d..9481e4552 100644 --- a/shiny/experimental/ui/_card.py +++ b/shiny/experimental/ui/_card.py @@ -58,9 +58,9 @@ def card( Parameters ---------- *args - Unnamed arguments can be any valid child of an [htmltools tag][htmltools::tags] - (which includes card items such as :func:`~shiny.experimental.ui.card_body`. - Named arguments become HTML attributes on the returned Tag. + Unnamed arguments can be any valid child of an :class:`~htmltools.Tag` (which + includes card items such as :func:`~shiny.experimental.ui.card_body`. Named + arguments become HTML attributes on the returned Tag. full_screen If `True`, an icon will appear when hovering over the card body. Clicking the icon expands the card to fit viewport size. @@ -157,8 +157,9 @@ def _full_screen_toggle_icon() -> HTML: class CardItem: """ - A wrapper around a `Tag` object that represents a card item (e.g., - :func:`~shiny.experimental.ui.card_body`, :func:`~shiny.experimental.ui.card_header`, etc.). + A wrapper around a :class:`~htmltools.Tag` object that represents a card item (e.g., + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.card_header`, etc.). This class is used to allow for consecutive non-card items to be bundled into a single `card_body` within :func:`~shiny.experimental.ui.card`. @@ -166,7 +167,7 @@ class CardItem: Parameters ---------- item - A `Tag` object that represents a card item (e.g., + A :class:`~htmltools.Tag` object that represents a card item (e.g., :func:`~shiny.experimental.ui.card_body`, :func:`~shiny.experimental.ui.card_header`, etc.). See Also @@ -233,7 +234,7 @@ def card_body( ---------- *args Contents to the card's body. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. fillable Whether or not the card item should be a fillable (i.e. flexbox) container. min_height,max_height,max_height_full_screen @@ -417,9 +418,10 @@ def __call__( ---------- *args Contents to the tag method. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. _add_ws - Whether or not to add whitespace to the returned `Tag` object. + Whether or not to add whitespace to the returned :class:`~htmltools.Tag` + object. **kwargs Additional HTML attributes for the returned Tag. @@ -447,9 +449,9 @@ def card_title( ---------- *args Contents to the card's title. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. container - Method for the returned Tag object. Defaults to :func:`~shiny.ui.h5`. + Method for the returned Tag object. Defaults to :func:`shiny.ui.tags.h5`. **kwargs Additional HTML attributes for the returned Tag. @@ -487,9 +489,9 @@ def card_header( ---------- *args Contents to the header container. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. container - Method for the returned Tag object. Defaults to :func:`~shiny.ui.div`. + Method for the returned Tag object. Defaults to :func:`~shiny.ui.tags.div`. **kwargs Additional HTML attributes for the returned Tag. @@ -528,7 +530,7 @@ def card_footer( ---------- *args Contents to the footer container. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. **kwargs Additional HTML attributes for the returned Tag. @@ -567,7 +569,8 @@ def __call__(self, *args: Tag) -> Tagifiable: Returns ------- : - A tagifiable object, such as a :class:`~htmltools.Tag` or :class:`~shiny.experimental.ui.CardItem` object. + A tagifiable object, such as a :class:`~htmltools.Tag` or + :class:`~shiny.experimental.ui.CardItem` object. """ ... @@ -602,7 +605,8 @@ def card_image( `**kwargs:TagAttrValue` (e.g. `{"src": "HOSTED_PATH_TO_IMAGE"}` or `src="HOSTED_PATH_TO_IMAGE"`). *args - Dictionary of tag attributes that are supplied to the resolved `Tag` object. + Dictionary of tag attributes that are supplied to the resolved + :class:`~htmltools.Tag` object. href An optional URL to link to. border_radius diff --git a/shiny/experimental/ui/_fill.py b/shiny/experimental/ui/_fill.py index 84a68d4b1..8792c6e02 100644 --- a/shiny/experimental/ui/_fill.py +++ b/shiny/experimental/ui/_fill.py @@ -102,8 +102,8 @@ def bind_fill_role( Returns ------- : - The original tag object (`tag`) with additional attributes (and a - `~shiny.ui.HtmlDependency`). + The original :class:`~htmltools.Tag` object (`tag`) with additional attributes + (and an :class:`~htmltools.HtmlDependency`). """ tag = _add_role( tag, @@ -148,12 +148,12 @@ def as_fill_carrier( Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- @@ -162,6 +162,12 @@ def as_fill_carrier( min_height,max_height,gap Any valid CSS unit (e.g., `150`) to be applied to `tag`. + Returns + ------- + : + The original :class:`~htmltools.Tag` object (`tag`) with additional attributes + (and an :class:`~htmltools.HtmlDependency`). + See Also -------- * :func:`~shiny.experimental.ui.as_fill_item` @@ -196,12 +202,12 @@ def as_fillable_container( Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- @@ -210,6 +216,11 @@ def as_fillable_container( min_height,max_height,gap Any valid CSS unit (e.g., `150`) to be applied to `tag`. + Returns + ------- + : + The original :class:`~htmltools.Tag` object (`tag`) with additional attributes + (and an :class:`~htmltools.HtmlDependency`). See Also -------- @@ -244,12 +255,12 @@ def as_fill_item( Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- @@ -258,6 +269,11 @@ def as_fill_item( min_height,max_height Any valid CSS unit (e.g., `150`) to be applied to `tag`. + Returns + ------- + : + The original :class:`~htmltools.Tag` object (`tag`) with additional attributes + (and an :class:`~htmltools.HtmlDependency`). See Also -------- @@ -282,18 +298,24 @@ def remove_all_fill(tag: TagFillingLayoutT) -> TagFillingLayoutT: Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- tag a Tag object. + Returns + ------- + : + The original :class:`~htmltools.Tag` object with filling layout attributes + removed. + See Also -------- @@ -322,18 +344,22 @@ def is_fill_carrier(tag: Tag | FillingLayout) -> bool: Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- tag a Tag object. + Returns + ------- + : + Whether or not `tag` is a fill carrier. See Also -------- @@ -353,18 +379,23 @@ def is_fillable_container(tag: TagChild | FillingLayout) -> bool: Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- tag a Tag object. + Returns + ------- + : + Whether or not `tag` is a fillable container. + See Also -------- @@ -388,18 +419,22 @@ def is_fill_item(tag: TagChild | FillingLayout) -> bool: Filling layouts are built on the foundation of _fillable containers_ and _fill items_ (_fill carriers_ are both _fillable containers_ and _fill items_). This is - why most UI components (e.g., :func:`~shiny.experiemental.ui.card`, - :func:`~shiny.experiemental.ui.card_body`, - :func:`~shiny.experiemental.ui.layout_sidebar`) possess both `fillable` and `fill` + why most UI components (e.g., :func:`~shiny.experimental.ui.card`, + :func:`~shiny.experimental.ui.card_body`, + :func:`~shiny.experimental.ui.layout_sidebar`) possess both `fillable` and `fill` arguments (to control their fill behavior). However, sometimes it's useful to add, - remove, and/or test fillable/fill properties on arbitrary `~htmltools.Tag`, which - these functions are designed to do. + remove, and/or test fillable/fill properties on arbitrary :class:`~htmltools.Tag`, + which these functions are designed to do. Parameters ---------- tag a Tag object. + Returns + ------- + : + Whether or not `tag` is a fill item. See Also -------- diff --git a/shiny/experimental/ui/_input_text.py b/shiny/experimental/ui/_input_text.py index 6d4f8a7ef..fe48cabfa 100644 --- a/shiny/experimental/ui/_input_text.py +++ b/shiny/experimental/ui/_input_text.py @@ -29,8 +29,8 @@ def input_text_area( ) -> Tag: """ Create a textarea input control for entry of unstructured text values. This is an - experimental version of shiny.ui.input_text_area that can automatically resize to - fit the input text. + experimental version of :func:`~shiny.ui.input_text_area` that can automatically + resize to fit the input text. Parameters ---------- @@ -59,13 +59,14 @@ def input_text_area( "vertical", and "horizontal". The default, ``None``, will use the client browser's default setting for resizing textareas. autoresize - If True, then the textarea will automatically resize to fit the input text. + If True, then the textarea will automatically resize the height to fit the input + text. autocomplete Whether to enable browser autocompletion of the text input (default is "off"). - If None, then it will use the browser's default behavior. Other possible values - include "on", "name", "username", and "email". See - https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for - more. + If `None`, then it will use the browser's default behavior. Other possible + values include "on", "name", "username", and "email". See [Mozila's autocomplete + documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + for more. spellcheck Whether to enable browser spell checking of the text input (default is None). If None, then it will use the browser's default behavior. @@ -77,14 +78,15 @@ def input_text_area( Notes ------ - .. admonition:: Server value - A string containing the current text input. The default value is ``""`` unless - ``value`` is provided. + ::: {.callout-note title="Server value"} + A string containing the current text input. The default value is ``""`` unless + ``value`` is provided. + ::: See Also ------- - ~shiny.ui.input_text + :func:`~shiny.ui.input_text` """ if resize and resize not in ["none", "both", "horizontal", "vertical"]: diff --git a/shiny/experimental/ui/_layout.py b/shiny/experimental/ui/_layout.py index 6bf6085fe..7c5c2dfb7 100644 --- a/shiny/experimental/ui/_layout.py +++ b/shiny/experimental/ui/_layout.py @@ -2,7 +2,7 @@ from typing import Literal, Optional -from htmltools import TagAttrs, TagAttrValue, TagChild, css, div +from htmltools import Tag, TagAttrs, TagAttrValue, TagChild, css, div from ._css_unit import CssUnit, as_css_unit from ._fill import as_fill_item, as_fillable_container @@ -21,7 +21,7 @@ def layout_column_wrap( gap: Optional[CssUnit] = None, class_: Optional[str] = None, **kwargs: TagAttrValue, -): +) -> Tag: # For # more explanation and illustrative examples, see # [here](https://rstudio.github.io/bslib/articles/cards.html#multiple-cards) @@ -34,19 +34,16 @@ def layout_column_wrap( Parameters ---------- width - The desired width of each card, which can be any of the following: - * A (unit-less) number between 0 and 1. - * This should be specified as `1/num`, where `num` represents the number - of desired columns. - * A CSS length unit - * Either the minimum (when `fixed_width=False`) or fixed width - (`fixed_width=True`). - * `None` - * Allows power users to set the `grid-template-columns` CSS property - manually, either via a `style` attribute or a CSS stylesheet. + The desired width of each card. It can be a (unit-less) number between 0 and 1 + and should be specified as `1/num`, where `num` represents the number of desired + columns. It can be a CSS length unit representing either the minimum (when + `fixed_width=False`) or fixed width (`fixed_width=True`). It can also be `None`, + which allows power users to set the `grid-template-columns` CSS property + manually, either via a `style` attribute or a CSS stylesheet. *args - Unnamed arguments should be UI elements (e.g., [card()]). Named arguments become - attributes on the containing [htmltools::tag] element. + Unnamed arguments should be UI elements (e.g., + :func:`~shiny.experimental.ui.card`). Named arguments become attributes on the + containing :class:`~htmltools.Tag` element. fixed_width Whether or not to interpret the `width` as a minimum (`fixed_width=False`) or fixed (`fixed_width=True`) width when it is a CSS length unit. @@ -56,7 +53,7 @@ def layout_column_wrap( height, but heights may vary between rows. fill Whether or not to allow the layout to grow/shrink to fit a fillable container - with an opinionated height (e.g., `page_fillable()`). + with an opinionated height (e.g., :func:`~shiny.experimental.ui.page_fillable`). fillable Whether or not each element is wrapped in a fillable container. height @@ -71,7 +68,10 @@ def layout_column_wrap( **kwargs Additional attributes to apply to the containing element. - + Returns + ------- + : + A :class:`~htmltools.Tag` element. """ attrs, children = consolidate_attrs(*args, class_=class_, **kwargs) diff --git a/shiny/experimental/ui/_output.py b/shiny/experimental/ui/_output.py index 885931f06..2344af5c4 100644 --- a/shiny/experimental/ui/_output.py +++ b/shiny/experimental/ui/_output.py @@ -7,7 +7,6 @@ from htmltools import Tag, TagAttrValue, TagFunction, css, div, tags -from ..._docstring import add_example from ..._namespaces import resolve_id from ...types import MISSING, MISSING_TYPE from ...ui._plot_output_opts import ( @@ -24,7 +23,7 @@ from ._fill import as_fill_item, as_fillable_container -@add_example() +# @add_example() def output_plot( id: str, width: str = "100%", @@ -118,7 +117,7 @@ def output_plot( return res -@add_example() +# @add_example() def output_image( id: str, width: str = "100%", @@ -229,7 +228,7 @@ def output_image( return container -@add_example() +# @add_example() def output_ui( id: str, inline: bool = False, diff --git a/shiny/experimental/ui/_page.py b/shiny/experimental/ui/_page.py index a9251f750..d125f1619 100644 --- a/shiny/experimental/ui/_page.py +++ b/shiny/experimental/ui/_page.py @@ -169,7 +169,7 @@ def page_navbar( ------- * :func:`~shiny.ui.nav` * :func:`~shiny.ui.nav_menu` - * :func:`~shiny.ui.navset_bar` + * :func:`~shiny.experimental.ui.navset_bar` * :func:`~shiny.ui.page_fluid` Example @@ -233,6 +233,40 @@ def page_fillable( lang: Optional[str] = None, **kwargs: TagAttrValue, ) -> Tag: + """ + Creates a fillable page + + Parameters + ---------- + *args + UI elements. + padding + Padding to use for the body. See :func:`~shiny.experimental.ui.as_css_padding` + for more details. + fillable_mobile + Whether or not the page should fill the viewport's height on mobile devices + (i.e., narrow windows). + gap + A CSS length unit passed through :func:`~shiny.experimental.ui.as_css_unit` + defining the `gap` (i.e., spacing) between elements provided to `*args`. + title + The browser window title (defaults to the host URL of the page). Can also be set + as a side effect via :func:`~shiny.ui.panel_title`. + lang + ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This + will be used as the lang in the ```` tag, as in ````. The + default, `None`, results in an empty string. + + Returns + ------- + : + A UI element. + + See Also + ------- + * :func:`~shiny.ui.page_fluid` + * :func:`~shiny.ui.page_fixed` + """ attrs, children = consolidate_attrs(*args, **kwargs) style = css( diff --git a/shiny/experimental/ui/_sidebar.py b/shiny/experimental/ui/_sidebar.py index bf6ed668d..245e436f0 100644 --- a/shiny/experimental/ui/_sidebar.py +++ b/shiny/experimental/ui/_sidebar.py @@ -24,15 +24,15 @@ class Sidebar: Sidebar object Class returned from :func:`~shiny.experimental.ui.sidebar`. Please do not use this - class directly. Instead, supply the `sidebar()` object to + class directly. Instead, supply the :func:`~shiny.experimental.ui.sidebar` object to :func:`~shiny.experimental.ui.layout_sidebar`. Attributes ---------- tag - The `Tag` object that represents the sidebar. + The :class:`~htmltools.Tag` object that represents the sidebar. collapse_tag - The `Tag` object that represents the collapse button. + The :class:`~htmltools.Tag` object that represents the collapse button. position Where the sidebar should appear relative to the main content. open @@ -52,9 +52,9 @@ class directly. Instead, supply the `sidebar()` object to Parameters ---------- tag - The `Tag` object that represents the sidebar. + The :class:`~htmltools.Tag` object that represents the sidebar. collapse_tag - The `Tag` object that represents the collapse button. + The :class:`~htmltools.Tag` object that represents the collapse button. position Where the sidebar should appear relative to the main content. open @@ -134,7 +134,7 @@ def sidebar( * :func:`~shiny.experimental.ui.layout_sidebar` * Creates a sidebar layout component which can be dropped inside any :func:`~shiny.ui.page` or :func:`~shiny.experimental.ui.card` context. - * :func:`~shiny.experimental.ui.page_navbar`, :func:`~shiny.experimental.ui.navset_card_tab`, and :func:`~shiny.experimental.ui.navset_card_pill` + * :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_tab_card`, and :func:`~shiny.experimental.ui.navset_pill_card` * Creates a multi page/tab UI with a singular `sidebar()` (which is shown on every page/tab). @@ -142,19 +142,16 @@ def sidebar( ---------- *args Contents to the sidebar. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. width A valid CSS unit used for the width of the sidebar. position Where the sidebar should appear relative to the main content. open - The initial state of the sidebar, choosing from the following options: - - * `"desktop"`: The sidebar starts open on desktop screen, closed on mobile. - This is default sidebar behavior. - * `"open"` or `True`: The sidebar starts open. - * `"closed"` or `False`: The sidebar starts closed. - * `"always"` or `None`: The sidebar is always open and cannot be closed. + The initial state of the sidebar. It can be `"desktop"` (the sidebar starts open + on desktop screen, closed on mobile), `"open"` or `True` (the sidebar starts + open), `"closed"` or `False` (the sidebar starts closed), or `"always"` or + `None` (the sidebar is always open and cannot be closed). In :func:`~shiny.experimental.ui.sidebar_toggle`, `open` indicates the desired state of the sidebar, where the default of `open = None` will cause the sidebar @@ -183,14 +180,14 @@ def sidebar( Returns ------- : - A `Sidebar` object. + A :class:`~shiny.experimental.ui.Sidebar` object. See Also -------- * :func:`~shiny.experimental.ui.layout_sidebar` - * :func:`~shiny.experimental.ui.navset_navbar` - * :func:`~shiny.experimental.ui.navset_card_tab` - * :func:`~shiny.experimental.ui.navset_card_pill` + * :func:`~shiny.experimental.ui.navset_bar` + * :func:`~shiny.experimental.ui.navset_tab_card` + * :func:`~shiny.experimental.ui.navset_pill_card` """ # TODO-future; validate `open`, bg, fg, class_, max_height_mobile @@ -268,10 +265,10 @@ def layout_sidebar( Parameters ---------- sidebar - A `Sidebar` object created by :func:`~shiny.experimental.ui.sidebar`. + A :class:`~shiny.experimental.ui.Sidebar` object created by :func:`~shiny.experimental.ui.sidebar`. *args Contents to the main content area. Or tag attributes that are supplied to the - resolved `Tag` object. + resolved :class:`~htmltools.Tag` object. fillable Whether or not the main content area should be wrapped in a fillable container. See :func:`~shiny.experimental.ui.as_fillable_container` for details. @@ -304,7 +301,7 @@ def layout_sidebar( Returns ------- : - A `Tag` object. + A :class:`~htmltools.Tag` object. See Also -------- @@ -407,21 +404,17 @@ def sidebar_toggle( """ Toggle a sidebar - Toggle a `sidebar()` state during an active Shiny user session. + Toggle a :func:`~shiny.experimental.ui.sidebar` state during an active Shiny user session. Parameters ---------- id - The `id` of the `sidebar()` to toggle. + The `id` of the :func:`~shiny.experimental.ui.sidebar` to toggle. open - The desired state of the sidebar, choosing from the following options: - - * `None`: toggle sidebar open/closed - * `"open"` or `True`: The sidebar starts open. - * `"closed"` or `False`: The sidebar starts closed. - - Note that `sidebar_toggle()` can only open or close the sidebar, so it does not - support the `"desktop"` and `"always"` + The desired state of the sidebar, choosing from the following options: `None` + (toggle sidebar open and closed), `"open"` or `True` (open the sidebar), + `"closed"` or `False` (close the sidebar). Note that `sidebar_toggle()` can only + open or close the sidebar, so it does not support the `"desktop"` and `"always"` session A Shiny session object (the default should almost always be used). @@ -519,17 +512,17 @@ class DeprecatedPanelSidebar: ---------- *args Contents to the sidebar. Or tag attributes that are supplied to the resolved - `Tag` object. + :class:`~htmltools.Tag` object. width An integeger between 1 and 12, inclusive, that determines the width of the sidebar. The default is 4. **kwargs - Tag attributes that are supplied to the resolved `Tag` object. + Tag attributes that are supplied to the resolved :class:`~htmltools.Tag` object. Attributes ---------- sidebar - A `~shiny.experimental.ui.Sidebar` object. + A output from :func:`~shiny.experimental.ui.sidebar`. See Also -------- diff --git a/shiny/experimental/ui/_valuebox.py b/shiny/experimental/ui/_valuebox.py index f47c71932..7a32d9593 100644 --- a/shiny/experimental/ui/_valuebox.py +++ b/shiny/experimental/ui/_valuebox.py @@ -43,17 +43,18 @@ def value_box( Parameters ---------- title,value - A string, number, or :func:`~htmltools.tag` child to display as + A string, number, or :class:`~htmltools.Tag` child to display as the title or value of the value box. The `title` appears above the `value`. *args - Unnamed arguments may be any :func:`~htmltools.tag` children to display below + Unnamed arguments may be any :class:`~htmltools.Tag` children to display below `value`. Named arguments are passed to :func:`~shiny.experimental.ui.card` as element attributes. showcase - A :func:`~htmltools.tag` child to showcase (e.g., an icon, a + A :class:`~htmltools.Tag` child to showcase (e.g., an icon, a :func:`~shiny.ui.output_plot`, etc). showcase_layout - Either :func:`~showcase_left_center` or :func:`~showcase_top_right`. + Either :func:`~shiny.experimental.ui.showcase_left_center` or + :func:`~shiny.experimental.ui.showcase_top_right`. theme_color A theme color to use for the background color. Should match a name in the Bootstrap Sass variable `$theme-colors` (e.g., `"secondary"`, `"success"`, @@ -61,7 +62,7 @@ def value_box( height,max_height Any valid CSS unit (e.g., `height="200px"`). Doesn't apply when a card is made `full_screen` (in this case, consider setting a `height` in - :func:`~shiny.experimental.ui.card_body()`). + :func:`~shiny.experimental.ui.card_body`). fill Whether to allow the value box to grow/shrink to fit a fillable container with an opinionated height (e.g., :func:`~shiny.experimental.ui.page_fillable`). @@ -132,15 +133,12 @@ def showcase_left_center( Parameters ---------- width - one of the following: - * A proportion (i.e., a number between 0 and 1) of available width to allocate - to the showcase. - * A vector of length 2 valid CSS unit defining the width of each column (for - `showcase_left_center()` the 1st unit defines the showcase width and for - `showcase_top_right` the 2nd unit defines the showcase width). Note that any - units supported by the CSS grid `grid-template-columns` property may be used - (e.g., `fr` units). - + A proportion (i.e., a number between 0 and 1) of available width to allocate to + the showcase. Or, A vector of length 2 valid CSS unit defining the width of each + column (for `showcase_left_center()` the 1st unit defines the showcase width and + for `showcase_top_right` the 2nd unit defines the showcase width). Note that any + units supported by the CSS grid `grid-template-columns` property may be used + (e.g., `fr` units). max_height,max_height_full_screen A proportion (i.e., a number between 0 and 1) or any valid CSS unit defining the showcase max_height. @@ -164,6 +162,30 @@ def showcase_top_right( max_height: CssUnit = "75px", max_height_full_screen: CssUnit = "67%", ) -> Callable[[TagChild | TagAttrs, Tag], CardItem]: + """ + Top right showcase for a value box + + Gives the showcase a width and in the top right corner. + + Parameters + ---------- + width + A proportion (i.e., a number between 0 and 1) of available width to allocate to + the showcase. Or, A vector of length 2 valid CSS unit defining the width of each + column (for `showcase_left_center()` the 1st unit defines the showcase width and + for `showcase_top_right` the 2nd unit defines the showcase width). Note that any + units supported by the CSS grid `grid-template-columns` property may be used + (e.g., `fr` units). + max_height,max_height_full_screen + A proportion (i.e., a number between 0 and 1) or any valid CSS unit defining the + showcase max_height. + + Returns + ------- + : + A function that takes a showcase and contents and returns a :func:`~shiny.experimental.ui.card_body` + """ + if is_01_scalar(width): width = 1 - width return _showcase_layout( diff --git a/shiny/render/_dataframe.py b/shiny/render/_dataframe.py index 567503292..3eebad1b7 100644 --- a/shiny/render/_dataframe.py +++ b/shiny/render/_dataframe.py @@ -303,22 +303,12 @@ def data_frame( """ Reactively render a Pandas data frame object (or similar) as a basic HTML table. - Parameters - ---------- - index - Whether to print index (row) labels. - selection - - Returns ------- : - A decorator for a function that returns any of the following: - - 1. A pandas :class:`DataFrame` object. - 2. A pandas :class:`Styler` object. - 3. Any object that has a `.to_pandas()` method (e.g., a Polars data frame or - Arrow table). + A decorator for a function that returns either a pandas :class:`DataFrame` + object, pandas :class:`Styler` object, or any object that has a `.to_pandas()` + method (e.g., a Polars data frame or Arrow table). Tip ---- diff --git a/shiny/ui/_include_helpers.py b/shiny/ui/_include_helpers.py index 98865ae36..3a100456b 100644 --- a/shiny/ui/_include_helpers.py +++ b/shiny/ui/_include_helpers.py @@ -34,22 +34,19 @@ def include_js( path A path to a JS file. method - One of the following: - * ``"link"``: Link to the JS file via a :func:`~ui.tags.script` tag. This - method is generally preferrable to ``"inline"`` since it allows the browser - to cache the file. - * ``"link_files"``: Same as ``"link"``, but also allow for the JS file to - request other files within ``path``'s immediate parent directory (e.g., - ``import()` another file, if it is loaded with `type="module"`). Note that this isn't the default - behavior because you should **be careful not to include files in the same - directory as ``path`` that contain sensitive information**. A good general - rule of thumb to follow is to have ``path`` be located in a subdirectory of - the app directory. For example, if the app's source is located at - ``/app/app.py``, then ``path`` should be somewhere like - ``/app/js/custom.js`` (and all the other relevant accompanying 'safe' files - should be located under ``/app/js/``). - * ``"inline"``: Inline the JS file contents within a :func:`~ui.tags.script` - tag. + One of the following: ``"link"``, ``"link_files"``, or ``"inline"``. ``"link"`` + is the link to the CSS file via a :func:`~ui.tags.link` tag. This method is + generally preferrable to ``"inline"`` since it allows the browser to cache the + file. ``"link_files"`` is the same as ``"link"``, but also allow for the CSS + file to request other files within ``path``'s immediate parent directory (e.g., + ``@import()`` another file). Note that this isn't the default behavior because + you should **be careful not to include files in the same directory as ``path`` + that contain sensitive information**. A good general rule of thumb to follow is + to have ``path`` be located in a subdirectory of the app directory. For example, + if the app's source is located at ``/app/app.py``, then ``path`` should be + somewhere like ``/app/css/custom.css`` (and all the other relevant accompanying + 'safe' files should be located under ``/app/css/``). And finally, ``"inline"`` + is the inline the CSS file contents within a :func:`~ui.tags.style` tag. **kwargs Attributes which are passed on to `~ui.tags.script` @@ -107,22 +104,19 @@ def include_css( path A path to a CSS file. method - One of the following: - * ``"link"``: Link to the CSS file via a :func:`~ui.tags.link` tag. This - method is generally preferrable to ``"inline"`` since it allows the browser - to cache the file. - * ``"link_files"``: Same as ``"link"``, but also allow for the CSS file to - request other files within ``path``'s immediate parent directory (e.g., - ``@import()`` another file). Note that this isn't the default behavior - because you should **be careful not to include files in the same directory - as ``path`` that contain sensitive information**. A good general rule of - thumb to follow is to have ``path`` be located in a subdirectory of the app - directory. For example, if the app's source is located at ``/app/app.py``, - then ``path`` should be somewhere like ``/app/css/custom.css`` (and all the - other relevant accompanying 'safe' files should be located under - ``/app/css/``). - * ``"inline"``: Inline the CSS file contents within a :func:`~ui.tags.style` - tag. + One of the following: ``"link"``, ``"link_files"``, or ``"inline"``. ``"link"`` + is the link to the CSS file via a :func:`~ui.tags.link` tag. This method is + generally preferrable to ``"inline"`` since it allows the browser to cache the + file. ``"link_files"`` is the same as ``"link"``, but also allow for the CSS + file to request other files within ``path``'s immediate parent directory (e.g., + ``@import()`` another file). Note that this isn't the default behavior because + you should **be careful not to include files in the same directory as ``path`` + that contain sensitive information**. A good general rule of thumb to follow is + to have ``path`` be located in a subdirectory of the app directory. For example, + if the app's source is located at ``/app/app.py``, then ``path`` should be + somewhere like ``/app/css/custom.css`` (and all the other relevant accompanying + 'safe' files should be located under ``/app/css/``). And finally, ``"inline"`` + is the inline the CSS file contents within a :func:`~ui.tags.style` tag. Returns diff --git a/shiny/ui/_input_action_button.py b/shiny/ui/_input_action_button.py index e95d046ea..cc2d29bca 100644 --- a/shiny/ui/_input_action_button.py +++ b/shiny/ui/_input_action_button.py @@ -41,9 +41,9 @@ def input_action_button( Notes ------ - .. admonition:: Server value - - An integer representing the number of clicks. + ::: {.callout-note title="Server value"} + An integer representing the number of clicks. + ::: See Also ------- @@ -92,9 +92,9 @@ def input_action_link( Notes ------ - .. admonition:: Server value - - An integer representing the number of clicks. + ::: {.callout-note title="Server value"} + An integer representing the number of clicks. + ::: See Also ------- diff --git a/shiny/ui/_input_check_radio.py b/shiny/ui/_input_check_radio.py index ddca75dbc..a83bfd5fb 100644 --- a/shiny/ui/_input_check_radio.py +++ b/shiny/ui/_input_check_radio.py @@ -53,9 +53,9 @@ def input_checkbox( Notes ------ - .. admonition:: Server value - - ``True`` if checked, ``False`` otherwise. + ::: {.callout-note title="Server value"} + ``True`` if checked, ``False`` otherwise. + ::: See Also ------- @@ -110,9 +110,9 @@ def input_switch( Notes ------ - .. admonition:: Server value - - ``True`` if checked, ``False`` otherwise. + ::: {.callout-note title="Server value"} + ``True`` if checked, ``False`` otherwise. + ::: See Also ------- @@ -188,9 +188,9 @@ def input_checkbox_group( Notes ------ - .. admonition:: Server value - - A tuple of string(s) with the selected value(s) (if any). + ::: {.callout-note title="Server value"} + A tuple of string(s) with the selected value(s) (if any). + ::: See Also ------- @@ -257,9 +257,9 @@ def input_radio_buttons( Notes ------ - .. admonition:: Server value - - A string with the selected value. + ::: {.callout-note title="Server value"} + A string with the selected value. + ::: See Also ------- diff --git a/shiny/ui/_input_date.py b/shiny/ui/_input_date.py index 22aa1929b..f3d0e1c78 100644 --- a/shiny/ui/_input_date.py +++ b/shiny/ui/_input_date.py @@ -100,9 +100,9 @@ def input_date( Notes ------ - .. admonition:: Server value - - A :class:`~datetime.date` object. + ::: {.callout-note title="Server value"} + A :class:`~datetime.date` object. + ::: See Also ------- @@ -218,9 +218,9 @@ def input_date_range( Notes ------ - .. admonition:: Server value - - A tuple of :class:`~datetime.date` objects. + ::: {.callout-note title="Server value"} + A tuple of :class:`~datetime.date` objects. + ::: See Also ------- diff --git a/shiny/ui/_input_file.py b/shiny/ui/_input_file.py index 53b9ee2c7..5de0ae6d5 100644 --- a/shiny/ui/_input_file.py +++ b/shiny/ui/_input_file.py @@ -37,12 +37,10 @@ def input_file( accept Unique file type specifier(s) which give the browser a hint as to the type of file the server expects. Many browsers use this to prevent the user from - selecting an invalid file. Examples of valid values include: - - * A case insensitive extension like ``.csv`` or ``.rds``. - * A valid MIME type, like ``text/plain`` or ``application/pdf`` - * One of ``audio/*``, ``video/*``, or ``image/*`` meaning any audio, video, - or image type, respectively. + selecting an invalid file. Examples of valid values include a case insensitive + extension (e.g. ``.csv`` or ``.rds``), a valid MIME type (e.g. ``text/plain`` or + ``application/pdf``) or one of ``audio/*``, ``video/*``, or ``image/*`` meaning + any audio, video, or image type, respectively. width The CSS width, e.g. '400px', or '100%' button_label @@ -64,17 +62,17 @@ def input_file( Notes ----- - .. admonition:: Server value - - A list of dictionaries (one for each file upload) with the following keys: - - * name: The filename provided by the web browser. This is *not* the path to read - to get at the actual data that was uploaded (see 'datapath'). - * size: The size of the uploaded data, in bytes. - * type: The MIME type reported by the browser (for example, 'text/plain'), or - empty string if the browser didn't know. - * datapath: The path to a temp file that contains the data that was uploaded. - This file may be deleted if the user performs another upload operation. + ::: {.callout-note title="Server value"} + A list of dictionaries (one for each file upload) with the following keys: + + * name: The filename provided by the web browser. This is *not* the path to read + to get at the actual data that was uploaded (see 'datapath'). + * size: The size of the uploaded data, in bytes. + * type: The MIME type reported by the browser (for example, 'text/plain'), or + empty string if the browser didn't know. + * datapath: The path to a temp file that contains the data that was uploaded. + This file may be deleted if the user performs another upload operation. + ::: See Also -------- diff --git a/shiny/ui/_input_numeric.py b/shiny/ui/_input_numeric.py index a5d2f8beb..aa8111ae8 100644 --- a/shiny/ui/_input_numeric.py +++ b/shiny/ui/_input_numeric.py @@ -47,9 +47,9 @@ def input_numeric( Notes ------ - .. admonition:: Server value - - A numeric value. + ::: {.callout-note title="Server value"} + A numeric value. + ::: See Also ------- diff --git a/shiny/ui/_input_password.py b/shiny/ui/_input_password.py index a63b09ed7..090ea1e33 100644 --- a/shiny/ui/_input_password.py +++ b/shiny/ui/_input_password.py @@ -41,9 +41,9 @@ def input_password( Notes ------ - .. admonition:: Server value - - A string of the password input. The default value is unless value is provided. + ::: {.callout-note title="Server value"} + A string of the password input. The default value is unless value is provided. + ::: See Also ------- diff --git a/shiny/ui/_input_select.py b/shiny/ui/_input_select.py index d5fbcac9c..a10538414 100644 --- a/shiny/ui/_input_select.py +++ b/shiny/ui/_input_select.py @@ -83,10 +83,10 @@ def input_selectize( Notes ------ - .. admonition:: Server value - - A list of strings, usually of length 1, with the value of the selected items. When - ``multiple=True`` and nothing is selected, this value will be ``None``. + ::: {.callout-note title="Server value"} + A list of strings, usually of length 1, with the value of the selected items. When + ``multiple=True`` and nothing is selected, this value will be ``None``. + ::: See Also ------- @@ -152,10 +152,10 @@ def input_select( Notes ------ - .. admonition:: Server value - - A list of strings, usually of length 1, with the value of the selected items. When - ``multiple=True`` and nothing is selected, this value will be ``None``. + ::: {.callout-note title="Server value"} + A list of strings, usually of length 1, with the value of the selected items. When + ``multiple=True`` and nothing is selected, this value will be ``None``. + ::: See Also ------- diff --git a/shiny/ui/_input_slider.py b/shiny/ui/_input_slider.py index b4eb91071..5d440cf14 100644 --- a/shiny/ui/_input_slider.py +++ b/shiny/ui/_input_slider.py @@ -130,10 +130,10 @@ def input_slider( Notes ------ - .. admonition:: Server value - - A number, date, or date-time (depending on the class of value), or in the case of - slider range, a list of two numbers/dates/date-times. + ::: {.callout-note title="Server value"} + A number, date, or date-time (depending on the class of value), or in the case of + slider range, a list of two numbers/dates/date-times. + ::: See Also ------- diff --git a/shiny/ui/_input_text.py b/shiny/ui/_input_text.py index d94ff3f9d..62b14afad 100644 --- a/shiny/ui/_input_text.py +++ b/shiny/ui/_input_text.py @@ -52,10 +52,10 @@ def input_text( Notes ------ - .. admonition:: Server value - - A string containing the current text input. The default value is ``""`` unless - ``value`` is provided. + ::: {.callout-note title="Server value"} + A string containing the current text input. The default value is ``""`` unless + ``value`` is provided. + ::: See Also ------- @@ -139,10 +139,10 @@ def input_text_area( Notes ------ - .. admonition:: Server value - - A string containing the current text input. The default value is ``""`` unless - ``value`` is provided. + ::: {.callout-note title="Server value"} + A string containing the current text input. The default value is ``""`` unless + ``value`` is provided. + ::: See Also ------- diff --git a/shiny/ui/_page.py b/shiny/ui/_page.py index af09802b8..358c89c13 100644 --- a/shiny/ui/_page.py +++ b/shiny/ui/_page.py @@ -133,12 +133,12 @@ def page_fluid( args UI elements. title - The browser window title (defaults to the host URL of the page). Can also be set as - a side effect via :func:`~shiny.ui.panel_title`. + The browser window title (defaults to the host URL of the page). Can also be set + as a side effect via :func:`~shiny.ui.panel_title`. lang - ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This will - be used as the lang in the ```` tag, as in ````. The default, - `None`, results in an empty string. + ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This + will be used as the lang in the ```` tag, as in ````. The + default, `None`, results in an empty string. kwargs Attributes on the page level container. @@ -175,15 +175,15 @@ def page_fixed( args UI elements. title - The browser window title (defaults to the host URL of the page). Can also be set as - a side effect via :func:`~shiny.ui.panel_title`. + The browser window title (defaults to the host URL of the page). Can also be set + as a side effect via :func:`~shiny.ui.panel_title`. lang - ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This will - be used as the lang in the ```` tag, as in ````. The default, - `None`, results in an empty string. - + ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This + will be used as the lang in the ```` tag, as in ````. The + default, `None`, results in an empty string. kwargs Attributes on the page level container. + Returns ------- : @@ -214,12 +214,12 @@ def page_bootstrap( args UI elements. title - The browser window title (defaults to the host URL of the page). Can also be set as - a side effect via :func:`~shiny.ui.panel_title`. + The browser window title (defaults to the host URL of the page). Can also be set + as a side effect via :func:`~shiny.ui.panel_title`. lang - ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This will - be used as the lang in the ```` tag, as in ````. The default, - `None`, results in an empty string. + ISO 639-1 language code for the HTML page, such as ``"en"`` or ``"ko"``. This + will be used as the lang in the ```` tag, as in ````. The + default, `None`, results in an empty string. Returns ------- diff --git a/shiny/ui/dataframe/_dataframe.py b/shiny/ui/dataframe/_dataframe.py index cdc5b3555..1d439d5dc 100644 --- a/shiny/ui/dataframe/_dataframe.py +++ b/shiny/ui/dataframe/_dataframe.py @@ -24,6 +24,23 @@ def data_frame_deps() -> HTMLDependency: def output_data_frame(id: str) -> Tag: + """ + Create a output container for a data frame. + + Parameters + ---------- + id + An input id. + + Returns + ------- + : + A UI element. + + See Also + -------- + :func:`~shiny.render.data_frame` + """ return bind_fill_role( Tag( "shiny-data-frame",