Skip to content

Commit f469421

Browse files
authored
docs: Add Tooltip section in experimental (#673)
1 parent 23e13e6 commit f469421

File tree

7 files changed

+35
-19
lines changed

7 files changed

+35
-19
lines changed

docs/_quartodoc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,16 @@ quartodoc:
280280
- experimental.ui.value_box
281281
- experimental.ui.showcase_left_center
282282
- experimental.ui.showcase_top_right
283+
- kind: page
284+
path: ExTooltip
285+
summary:
286+
name: "Tooltips"
287+
desc: "Display additional information when focusing (or hovering over) a UI element."
288+
flatten: true
289+
contents:
290+
- experimental.ui.tooltip
291+
- experimental.ui.tooltip_toggle
292+
- experimental.ui.update_tooltip
283293
- kind: page
284294
path: ExFillingLayout
285295
summary:

shiny/experimental/ui/_card.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def card(
8686
Returns
8787
-------
8888
:
89-
An :func:`~htmltools.div` tag.
89+
An :func:`~shiny.ui.tags.div` tag.
9090
9191
See Also
9292
--------
@@ -314,12 +314,12 @@ def card_body(
314314
# https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols
315315
class WrapperCallable(Protocol):
316316
"""
317-
A callable that wraps children into a :func:`~shiny.experimental.ui.CardItem`.
317+
A callable that wraps children into a :class:`~shiny.experimental.ui.CardItem`.
318318
"""
319319

320320
def __call__(self, *args: TagChild) -> CardItem:
321321
"""
322-
Wraps children into a :func:`~shiny.experimental.ui.CardItem`.
322+
Wraps children into a :class:`~shiny.experimental.ui.CardItem`.
323323
324324
Parameters
325325
----------
@@ -554,7 +554,7 @@ def card_footer(
554554

555555
class ImgContainer(Protocol):
556556
"""
557-
A callable that wraps the return value of `card_image()`. To isolate your object in a card, return a :func:`~shiny.experimental.ui.CardItem`.
557+
A callable that wraps the return value of `card_image()`. To isolate your object in a card, return a :class:`~shiny.experimental.ui.CardItem`.
558558
"""
559559

560560
def __call__(self, *args: Tag) -> Tagifiable:
@@ -628,7 +628,7 @@ def card_image(
628628
If :func:`~shiny.experimental.ui.card_body` is used, each image will be in separate cards. If
629629
the `container` method does not return a :class:`~shiny.experimental.ui.CardItem`, it
630630
allows for consecutive non-`CardItem` objects to be bundled into a single
631-
:func:`~.shiny.experimental.card_body` within :func:`~shiny.experimental.ui.card`.
631+
:func:`~shiny.experimental.ui.card_body` within :func:`~shiny.experimental.ui.card`.
632632
**kwargs
633633
Additional HTML attributes for the resolved Tag.
634634
"""

shiny/experimental/ui/_fill.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
)
3232

3333
TagFillingLayoutT = TypeVar("TagFillingLayoutT", bound="Tag | FillingLayout")
34+
"""
35+
A :class:`~htmltools.Tag` object or an object that implements the
36+
:class:`~shiny.experimental.ui.FillingLayout` protocol.
37+
"""
38+
3439
TagT = TypeVar("TagT", bound="Tag")
3540

3641

@@ -103,7 +108,7 @@ def bind_fill_role(
103108
-------
104109
:
105110
The original :class:`~htmltools.Tag` object (`tag`) with additional attributes
106-
(and an :class:`~htmltools.HtmlDependency`).
111+
(and an :class:`~htmltools.HTMLDependency`).
107112
"""
108113
tag = _add_role(
109114
tag,
@@ -166,7 +171,7 @@ def as_fill_carrier(
166171
-------
167172
:
168173
The original :class:`~htmltools.Tag` object (`tag`) with additional attributes
169-
(and an :class:`~htmltools.HtmlDependency`).
174+
(and an :class:`~htmltools.HTMLDependency`).
170175
171176
See Also
172177
--------
@@ -220,7 +225,7 @@ def as_fillable_container(
220225
-------
221226
:
222227
The original :class:`~htmltools.Tag` object (`tag`) with additional attributes
223-
(and an :class:`~htmltools.HtmlDependency`).
228+
(and an :class:`~htmltools.HTMLDependency`).
224229
225230
See Also
226231
--------
@@ -273,7 +278,7 @@ def as_fill_item(
273278
-------
274279
:
275280
The original :class:`~htmltools.Tag` object (`tag`) with additional attributes
276-
(and an :class:`~htmltools.HtmlDependency`).
281+
(and an :class:`~htmltools.HTMLDependency`).
277282
278283
See Also
279284
--------

shiny/experimental/ui/_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def page_navbar(
131131
Choose a particular nav item to select by default value (should match it's
132132
``value``).
133133
sidebar
134-
A :func:`~shiny.ui.sidebar` component to display on every page.
134+
A :func:`~shiny.experimental.ui.sidebar` component to display on every page.
135135
fillable
136136
Whether or not the main content area should be considered a fillable
137137
(i.e., flexbox) container.

shiny/experimental/ui/_sidebar.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ def sidebar(
132132
`sidebar=` argument of:
133133
134134
* :func:`~shiny.experimental.ui.layout_sidebar`
135-
* Creates a sidebar layout component which can be dropped inside any
136-
:func:`~shiny.ui.page` or :func:`~shiny.experimental.ui.card` context.
135+
* Creates a sidebar layout component which can be dropped inside any Shiny UI page method (e.g. :func:`~shiny.experimental.ui.page_fillable`) or :func:`~shiny.experimental.ui.card` context.
137136
* :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_tab_card`, and :func:`~shiny.experimental.ui.navset_pill_card`
138137
* Creates a multi page/tab UI with a singular `sidebar()` (which is
139138
shown on every page/tab).
@@ -164,7 +163,7 @@ def sidebar(
164163
title
165164
A character title to be used as the sidebar title, which will be wrapped in a
166165
`<div>` element with class `sidebar-title`. You can also provide a custom
167-
:func:`~shiny.htmltools.tag` for the title element, in which case you'll
166+
:class:`~htmltools.Tag` for the title element, in which case you'll
168167
likely want to give this element `class = "sidebar-title"`.
169168
bg,fg
170169
A background or foreground color.
@@ -259,8 +258,9 @@ def layout_sidebar(
259258
"""
260259
Sidebar layout
261260
262-
Create a sidebar layout component which can be dropped inside any
263-
:func:`~shiny.ui.page` or :func:`~shiny.experimental.ui.card` context.
261+
Create a sidebar layout component which can be dropped inside any Shiny UI page
262+
method (e.g. :func:`~shiny.experimental.ui.page_fillable`) or
263+
:func:`~shiny.experimental.ui.card` context.
264264
265265
Parameters
266266
----------

shiny/experimental/ui/_tooltip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def tooltip(
5454
If `trigger` yields multiple HTML elements (e.g., a :class:`~htmltools.TagList` or
5555
complex [`shinywidgets`](https://github.com/rstudio/py-shinywidgets) object), the
5656
last HTML element is used as the trigger. If the `trigger` should contain all of
57-
those elements, wrap the object in a :func:`~htmltools.div` or :func:`~htmltools.span`.
57+
those elements, wrap the object in a :func:`~shiny.ui.tags.div` or
58+
:func:`~shiny.ui.tags.span`.
5859
5960
See Also
6061
--------

shiny/session/_session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,10 @@ class Inputs:
880880
"""
881881
A class representing Shiny input values.
882882
883-
This class provides access to a :class:`~shiny.session.Session`'s input values. The
884-
input values are reactive :class:`~shiny.reactive.Values`, and can be accessed with
883+
This class provides access to a :class:`~shiny.Session`'s input values. The
884+
input values are reactive :class:`~shiny.reactive.Value`s, and can be accessed with
885885
the ``[]`` operator, or with ``.``. For example, if there is an input named ``x``,
886-
it can be accessed via ``input["x"]()`` or ``input.x()``.
886+
it can be accessed via `input["x"]()` or ``input.x()``.
887887
"""
888888

889889
def __init__(

0 commit comments

Comments
 (0)