Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
17 changes: 17 additions & 0 deletions shiny/experimental/examples/input_text_area/app.py
Original file line number Diff line number Diff line change
@@ -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)
29 changes: 16 additions & 13 deletions shiny/experimental/ui/_accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
-------
Expand All @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
----------
Expand Down Expand Up @@ -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.

Expand Down
36 changes: 20 additions & 16 deletions shiny/experimental/ui/_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -157,16 +157,17 @@ 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`.

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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
"""
...

Expand Down Expand Up @@ -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
Expand Down
Loading