streamlit-nightly 1.35.1.dev20240613__py2.py3-none-any.whl → 1.35.1.dev20240614__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. streamlit/__init__.py +1 -1
  2. streamlit/commands/navigation.py +84 -18
  3. streamlit/components/v1/component_registry.py +24 -9
  4. streamlit/elements/arrow.py +17 -6
  5. streamlit/elements/deck_gl_json_chart.py +1 -1
  6. streamlit/elements/dialog_decorator.py +5 -3
  7. streamlit/elements/html.py +1 -9
  8. streamlit/elements/iframe.py +53 -10
  9. streamlit/elements/layouts.py +40 -4
  10. streamlit/elements/lib/column_types.py +1 -1
  11. streamlit/elements/map.py +1 -1
  12. streamlit/elements/markdown.py +18 -14
  13. streamlit/elements/plotly_chart.py +5 -2
  14. streamlit/elements/toast.py +1 -1
  15. streamlit/elements/vega_charts.py +93 -41
  16. streamlit/elements/widgets/button.py +6 -3
  17. streamlit/elements/widgets/data_editor.py +1 -1
  18. streamlit/elements/widgets/file_uploader.py +1 -1
  19. streamlit/elements/write.py +11 -10
  20. streamlit/hello/Mapping_Demo.py +1 -1
  21. streamlit/navigation/page.py +107 -19
  22. streamlit/runtime/caching/cache_data_api.py +5 -4
  23. streamlit/runtime/caching/cache_errors.py +1 -1
  24. streamlit/runtime/caching/cache_resource_api.py +5 -4
  25. streamlit/runtime/caching/legacy_cache_api.py +13 -12
  26. streamlit/runtime/fragment.py +57 -27
  27. streamlit/runtime/runtime_util.py +1 -1
  28. streamlit/runtime/scriptrunner/script_run_context.py +1 -1
  29. streamlit/runtime/secrets.py +2 -2
  30. streamlit/runtime/state/session_state.py +1 -1
  31. streamlit/runtime/state/session_state_proxy.py +1 -1
  32. streamlit/static/asset-manifest.json +4 -4
  33. streamlit/static/index.html +1 -1
  34. streamlit/static/static/js/{8427.59805a7f.chunk.js → 8427.5192ee0c.chunk.js} +1 -1
  35. streamlit/static/static/js/8536.f7b26b02.chunk.js +1 -0
  36. streamlit/static/static/js/{main.d4bbfd37.js → main.7994a814.js} +2 -2
  37. streamlit/testing/v1/app_test.py +4 -3
  38. streamlit/user_info.py +2 -4
  39. {streamlit_nightly-1.35.1.dev20240613.dist-info → streamlit_nightly-1.35.1.dev20240614.dist-info}/METADATA +9 -9
  40. {streamlit_nightly-1.35.1.dev20240613.dist-info → streamlit_nightly-1.35.1.dev20240614.dist-info}/RECORD +45 -45
  41. streamlit/static/static/js/8536.f8de3d9a.chunk.js +0 -1
  42. /streamlit/static/static/js/{main.d4bbfd37.js.LICENSE.txt → main.7994a814.js.LICENSE.txt} +0 -0
  43. {streamlit_nightly-1.35.1.dev20240613.data → streamlit_nightly-1.35.1.dev20240614.data}/scripts/streamlit.cmd +0 -0
  44. {streamlit_nightly-1.35.1.dev20240613.dist-info → streamlit_nightly-1.35.1.dev20240614.dist-info}/WHEEL +0 -0
  45. {streamlit_nightly-1.35.1.dev20240613.dist-info → streamlit_nightly-1.35.1.dev20240614.dist-info}/entry_points.txt +0 -0
  46. {streamlit_nightly-1.35.1.dev20240613.dist-info → streamlit_nightly-1.35.1.dev20240614.dist-info}/top_level.txt +0 -0
streamlit/__init__.py CHANGED
@@ -244,7 +244,7 @@ experimental_singleton = _experimental_singleton
244
244
  experimental_user = _UserInfoProxy()
245
245
 
246
246
 
247
- _EXPERIMENTAL_QUERY_PARAMS_DEPRECATE_MSG = "Refer to our [docs page](https://docs.streamlit.io/library/api-reference/utilities/st.query_params) for more information."
247
+ _EXPERIMENTAL_QUERY_PARAMS_DEPRECATE_MSG = "Refer to our [docs page](https://docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params) for more information."
248
248
 
249
249
  experimental_get_query_params = _deprecate_func_name(
250
250
  _get_query_params,
@@ -61,37 +61,103 @@ def navigation(
61
61
  """
62
62
  Configure the available pages in a multipage app.
63
63
 
64
- Call `st.navigation` in your main script with one or more pages defined by
65
- `st.Page`. `st.navigation` returns the current page which can be executed
66
- using `Page.run()`.
64
+ Call ``st.navigation`` in your entrypoint file with one or more pages
65
+ defined by ``st.Page``. ``st.navigation`` returns the current page, which
66
+ can be executed using ``.run()`` method.
67
67
 
68
- When using `st.navigation`, the main script is executed on every app rerun,
69
- with the current page executed in-line using `Page.run()`. The set of
70
- available pages can be updated with each rerun for dynamic navigation. In
71
- this mode, the `pages/` folder is ignored.
68
+ When using ``st.navigation``, your entrypoint file (the file passed to
69
+ ``streamlit run``) acts like a router or frame of common elements around
70
+ each of your pages. Streamlit executes the entrypoint file with every app
71
+ rerun. To execute the current page, you must call the ``.run()`` method on
72
+ the page object returned by ``st.navigation``.
72
73
 
73
- By default, `st.navigation` draws the available pages in the side
74
- navigation. This behavior can be changed using the `position=` keyword
75
- argument.
74
+ The set of available pages can be updated with each rerun for dynamic
75
+ navigation. By default, ``st.navigation`` draws the available pages in the
76
+ side navigation if there is more than one page. This behavior can be
77
+ changed using the ``position`` keyword argument.
78
+
79
+ As soon as any session of your app executes the ``st.navigation`` command,
80
+ your app will ignore the ``pages/`` directory (across all sessions).
76
81
 
77
82
  Parameters
78
83
  ----------
79
- pages: list[st.Page] or dict[str, list[st.Page]]
80
- A list of `st.Page` objects or a dictionary where the keys are section
81
- headers and the values are lists of `st.Page` objects.
84
+ pages: list[StreamlitPage] or dict[str, list[StreamlitPage]]
85
+ The available pages for the app.
86
+
87
+ To create labeled sections or page groupings within the navigation
88
+ menu, ``pages`` must be a dictionary. Each key is the label of a
89
+ section and each value is the list of ``StreamlitPage`` objects for
90
+ that section.
91
+
92
+ To create a navigation menu with no sections or page groupings,
93
+ ``pages`` must be a list of ``StreamlitPage`` objects.
94
+
95
+ Use ``st.Page`` to create ``StreamlitPage`` objects.
82
96
 
83
97
  position: "sidebar" or "hidden"
84
- The position of the navigation menu. Can be "sidebar" or "hidden".
98
+ The position of the navigation menu. If ``position`` is ``"sidebar"``
99
+ (default), the navigation widget appears at the top of the sidebar. If
100
+ ``position`` is ``"hidden"``, the navigation widget is not displayed.
101
+
102
+ If there is only one page in ``pages``, the navigation will be hidden
103
+ for any value of ``position``.
85
104
 
86
- Example
105
+ Returns
87
106
  -------
107
+ StreamlitPage
108
+ The current page selected by the user.
109
+
110
+ Examples
111
+ --------
112
+ The following examples show possible entrypoint files, which is the file
113
+ you pass to ``streamlit run``. Your entrypoint file manages your app's
114
+ navigation and serves as a router between pages.
115
+
116
+ You can declare pages from callables or file paths.
117
+
118
+ >>> import streamlit as st
119
+ >>> from page_functions import page1
120
+ >>>
121
+ >>> pg = st.navigation([st.Page(page1), st.Page("page2.py")])
122
+ >>> pg.run()
123
+
124
+ Use a dictionary to create sections within your navigation menu.
125
+
88
126
  >>> import streamlit as st
89
- >>> from pages import page1, page2
90
127
  >>>
91
- >>> pg = st.navigation([st.Page(page1), st.Page(page2)])
128
+ >>> pages = {
129
+ ... "Your account" : [
130
+ ... st.Page("create_account.py", title="Create your account"),
131
+ ... st.Page("manage_account.py", title="Manage your account")
132
+ ... ],
133
+ ... "Resources" : [
134
+ ... st.Page("learn.py", title="Learn about us"),
135
+ ... st.Page("trial.py", title="Try it out")
136
+ ... ]
137
+ ... }
92
138
  >>>
93
- >>> st.title("My Awesome App")
139
+ >>> pg = st.navigation(pages)
94
140
  >>> pg.run()
141
+
142
+ Call widget functions in your entrypoint file when you want a widget to be
143
+ stateful across pages. Assign keys to your common widgets and access their
144
+ values through Session State within your pages.
145
+
146
+ >>> import streamlit as st
147
+ >>>
148
+ >>> def page1():
149
+ >>> st.write(st.session_state.foo)
150
+ >>>
151
+ >>> def page2():
152
+ >>> st.write(st.session_state.bar)
153
+ >>>
154
+ >>> # Widgets shared by all the pages
155
+ >>> st.sidebar.selectbox("Foo", ["A", "B", "C"], key="foo")
156
+ >>> st.sidebar.checkbox("Bar", key="bar")
157
+ >>>
158
+ >>> pg = st.navigation(st.Page(page1), st.Page(page2))
159
+ >>> pg.run()
160
+
95
161
  """
96
162
  nav_sections = {"": pages} if isinstance(pages, list) else pages
97
163
  page_list = pages_from_nav_sections(nav_sections)
@@ -52,25 +52,40 @@ def declare_component(
52
52
  path: str | None = None,
53
53
  url: str | None = None,
54
54
  ) -> CustomComponent:
55
- """Create a custom component and register it if there is a ScriptRun context.
55
+ """Create a custom component and register it if there is a ``ScriptRunContext``.
56
56
 
57
- The component is not registered when there is no ScriptRun context; this can happen when CustomComponents are executed as standalone commands, e.g. for testing.
57
+ The component is not registered when there is no ``ScriptRunContext``.
58
+ This can happen when a ``CustomComponent`` is executed as standalone
59
+ command (e.g. for testing).
60
+
61
+ To use this function, import it from the ``streamlit.components.v1``
62
+ module.
63
+
64
+ .. warning::
65
+ Using ``st.components.v1.declare_component`` directly (instead of
66
+ importing its module) is deprecated and will be disallowd in a later
67
+ version.
58
68
 
59
69
  Parameters
60
70
  ----------
61
- name: str
62
- A short, descriptive name for the component. Like, "slider".
71
+ name : str
72
+ A short, descriptive name for the component, like "slider".
73
+
63
74
  path: str or None
64
- The path to serve the component's frontend files from. Either
65
- `path` or `url` must be specified, but not both.
75
+ The path to serve the component's frontend files from. If ``path`` is
76
+ ``None`` (default), Streamlit will server the component from the
77
+ location in ``url``. Either ``path`` or ``url`` must be specified, but
78
+ not both.
79
+
66
80
  url: str or None
67
- The URL that the component is served from. Either `path` or `url`
68
- must be specified, but not both.
81
+ The URL that the component is served from. If ``url`` is ``None``
82
+ (default), Streamlit will server the component from the location in
83
+ ``path``. Either ``path`` or ``url`` must be specified, but not both.
69
84
 
70
85
  Returns
71
86
  -------
72
87
  CustomComponent
73
- A CustomComponent that can be called like a function.
88
+ A ``CustomComponent`` that can be called like a function.
74
89
  Calling the component will create a new instance of the component
75
90
  in the Streamlit app.
76
91
 
@@ -95,12 +95,19 @@ class DataframeSelectionState(TypedDict, total=False):
95
95
  key and attribute notation. Selection states cannot be programmatically
96
96
  changed or set through Session State.
97
97
 
98
+ .. warning::
99
+ If a user sorts a dataframe, row selections will be reset. If your
100
+ users need to sort and filter the dataframe to make selections, direct
101
+ them to use the search function in the dataframe toolbar instead.
102
+
98
103
  Attributes
99
104
  ----------
100
105
  rows : list[int]
101
- The selected rows, identified by their positional index. The positional
102
- indices match the original dataframe, even if the user sorts the
103
- dataframe in their browser.
106
+ The selected rows, identified by their integer position. The integer
107
+ positions match the original dataframe, even if the user sorts the
108
+ dataframe in their browser. For a ``pandas.DataFrame``, you can
109
+ retrieve data from its interger position using methods like ``.iloc[]``
110
+ or ``.iat[]``.
104
111
  columns : list[str]
105
112
  The selected columns, identified by their names.
106
113
 
@@ -150,8 +157,12 @@ class DataframeState(TypedDict, total=False):
150
157
 
151
158
  Attributes
152
159
  ----------
153
- selection : DataframeSelectionState
154
- The state of the ``on_select`` event.
160
+ selection : dict
161
+ The state of the ``on_select`` event. This attribure returns a
162
+ dictionary-like object that supports both key and attribute notation.
163
+ The attributes are described by the ``DataframeSelectionState``
164
+ dictionary schema.
165
+
155
166
 
156
167
  """
157
168
 
@@ -346,7 +357,7 @@ class ArrowMixin:
346
357
  to change the displayed name of the column to "Dollar values"
347
358
  and add a "$" prefix in each cell. For more info on the
348
359
  available column types and config options, see
349
- `Column configuration <https://docs.streamlit.io/library/api-reference/data/st.column_config>`_.
360
+ `Column configuration <https://docs.streamlit.io/develop/api-reference/data/st.column_config>`_.
350
361
 
351
362
  To configure the index column(s), use ``_index`` as the column name.
352
363
 
@@ -66,7 +66,7 @@ class PydeckMixin:
66
66
 
67
67
  To get a token for yourself, create an account at https://mapbox.com.
68
68
  For more info on how to set config options, see
69
- https://docs.streamlit.io/library/advanced-features/configuration
69
+ https://docs.streamlit.io/develop/api-reference/configuration/config.toml.
70
70
 
71
71
  Parameters
72
72
  ----------
@@ -127,9 +127,11 @@ def dialog_decorator(
127
127
  handling any side effects of that behavior.
128
128
 
129
129
  .. warning::
130
- A dialog may not open another dialog. Only one dialog function may be
131
- called in a script run, which means that only one dialog can be open at
132
- any given time.
130
+ Only one dialog function may be called in a script run, which means
131
+ that only one dialog can be open at any given time. Since a dialog is
132
+ also a fragment, all fragment limitations apply. Dialogs can't contain
133
+ fragments, and fragments can't contain dialogs. Using dialogs in widget
134
+ callback functions is not supported.
133
135
 
134
136
  .. |st.experimental_fragment| replace:: ``st.experimental_fragment``
135
137
  .. _st.experimental_fragment: https://docs.streamlit.io/develop/api-reference/execution-flow/st.fragment
@@ -57,15 +57,7 @@ class HtmlMixin:
57
57
  -------
58
58
  >>> import streamlit as st
59
59
  >>>
60
- >>> code = \"""
61
- ... <style>
62
- ... p {
63
- ... color: red;
64
- ... }
65
- ... </style>
66
- ... \"""
67
- >>> st.html(code)
68
- >>> st.markdown("Lorem ipsum")
60
+ >>> st.html("<p><span style='text-decoration: line-through double red;'>Oops</span>!</p>")
69
61
 
70
62
  .. output::
71
63
  https://doc-html.streamlit.app/
@@ -34,18 +34,37 @@ class IframeMixin:
34
34
  ) -> DeltaGenerator:
35
35
  """Load a remote URL in an iframe.
36
36
 
37
+ To use this function, import it from the ``streamlit.components.v1``
38
+ module.
39
+
40
+ .. warning::
41
+ Using ``st.components.v1.iframe`` directly (instead of importing
42
+ its module) is deprecated and will be disallowd in a later version.
43
+
37
44
  Parameters
38
45
  ----------
39
46
  src : str
40
47
  The URL of the page to embed.
48
+
41
49
  width : int
42
- The width of the frame in CSS pixels. Defaults to the app's
43
- default element width.
50
+ The width of the iframe in CSS pixels. By default, this is the
51
+ app's default element width.
52
+
44
53
  height : int
45
- The height of the frame in CSS pixels. Defaults to 150.
54
+ The height of the frame in CSS pixels. By default, this is ``150``.
55
+
46
56
  scrolling : bool
47
- If True, show a scrollbar when the content is larger than the iframe.
48
- Otherwise, do not show a scrollbar. Defaults to False.
57
+ Whether to allow scrolling in the iframe. If this ``False``
58
+ (default), Streamlit crops any content larger than the iframe and
59
+ does not show a scrollbar. If this is ``True``, Streamlit shows a
60
+ scrollbar when the content is larger than the iframe.
61
+
62
+ Example
63
+ -------
64
+
65
+ >>> import streamlit.components.v1 as components
66
+ >>>
67
+ >>> components.iframe("https://example.com", height=500)
49
68
 
50
69
  """
51
70
  iframe_proto = IFrameProto()
@@ -68,18 +87,42 @@ class IframeMixin:
68
87
  ) -> DeltaGenerator:
69
88
  """Display an HTML string in an iframe.
70
89
 
90
+ To use this function, import it from the ``streamlit.components.v1``
91
+ module.
92
+
93
+ If you want to insert HTML text into your app without an iframe, try
94
+ ``st.html`` instead.
95
+
96
+ .. warning::
97
+ Using ``st.components.v1.html`` directly (instead of importing
98
+ its module) is deprecated and will be disallowd in a later version.
99
+
71
100
  Parameters
72
101
  ----------
73
102
  html : str
74
103
  The HTML string to embed in the iframe.
104
+
75
105
  width : int
76
- The width of the frame in CSS pixels. Defaults to the app's
77
- default element width.
106
+ The width of the iframe in CSS pixels. By default, this is the
107
+ app's default element width.
108
+
78
109
  height : int
79
- The height of the frame in CSS pixels. Defaults to 150.
110
+ The height of the frame in CSS pixels. By default, this is ``150``.
111
+
80
112
  scrolling : bool
81
- If True, show a scrollbar when the content is larger than the iframe.
82
- Otherwise, do not show a scrollbar. Defaults to False.
113
+ Whether to allow scrolling in the iframe. If this ``False``
114
+ (default), Streamlit crops any content larger than the iframe and
115
+ does not show a scrollbar. If this is ``True``, Streamlit shows a
116
+ scrollbar when the content is larger than the iframe.
117
+
118
+ Example
119
+ -------
120
+
121
+ >>> import streamlit.components.v1 as components
122
+ >>>
123
+ >>> components.html(
124
+ >>> "<p><span style='text-decoration: line-through double red;'>Oops</span>!</p>"
125
+ >>> )
83
126
 
84
127
  """
85
128
  iframe_proto = IFrameProto()
@@ -164,7 +164,8 @@ class LayoutsMixin:
164
164
  Columns can only be placed inside other columns up to one level of nesting.
165
165
 
166
166
  .. warning::
167
- Columns cannot be placed inside other columns in the sidebar. This is only possible in the main area of the app.
167
+ Columns cannot be placed inside other columns in the sidebar. This
168
+ is only possible in the main area of the app.
168
169
 
169
170
  Parameters
170
171
  ----------
@@ -180,10 +181,11 @@ class LayoutsMixin:
180
181
  the width of the first one, and the third one is three times that width.
181
182
 
182
183
  gap : "small", "medium", or "large"
183
- The size of the gap between the columns. Defaults to "small".
184
+ The size of the gap between the columns. The default is ``"small"``.
184
185
 
185
186
  vertical_alignment : "top", "center", or "bottom"
186
- The vertical alignment of the content inside the columns. Defaults to "top".
187
+ The vertical alignment of the content inside the columns. The
188
+ default is ``"top"``.
187
189
 
188
190
  Returns
189
191
  -------
@@ -232,6 +234,38 @@ class LayoutsMixin:
232
234
  https://doc-columns2.streamlit.app/
233
235
  height: 550px
234
236
 
237
+ Use ``vertical_alignment="bottom"`` to align widgets.
238
+
239
+ >>> import streamlit as st
240
+ >>>
241
+ >>> left, middle, right = st.columns(3, vertical_alignment="bottom")
242
+ >>>
243
+ >>> left.text_input("Write something")
244
+ >>> middle.button("Click me", use_container_width=True)
245
+ >>> right.checkbox("Check me")
246
+
247
+ .. output ::
248
+ https://doc-columns-bottom-widgets.streamlit.app/
249
+ height: 200px
250
+
251
+ Adjust vertical alignment to customize your grid layouts.
252
+
253
+ >>> import streamlit as st
254
+ >>> import numpy as np
255
+ >>>
256
+ >>> vertical_alignment = st.selectbox(
257
+ >>> "Vertical alignment", ["top", "center", "bottom"], index=2
258
+ >>> )
259
+ >>>
260
+ >>> left, middle, right = st.columns(3, vertical_alignment=vertical_alignment)
261
+ >>> left.image("https://static.streamlit.io/examples/cat.jpg")
262
+ >>> middle.image("https://static.streamlit.io/examples/dog.jpg")
263
+ >>> right.image("https://static.streamlit.io/examples/owl.jpg")
264
+
265
+ .. output ::
266
+ https://doc-columns-vertical-alignment.streamlit.app/
267
+ height: 600px
268
+
235
269
  """
236
270
  weights = spec
237
271
  if isinstance(weights, int):
@@ -244,7 +278,7 @@ class LayoutsMixin:
244
278
  raise StreamlitAPIException(
245
279
  "The input argument to st.columns must be either a "
246
280
  "positive integer or a list of positive numeric weights. "
247
- "See [documentation](https://docs.streamlit.io/library/api-reference/layout/st.columns) "
281
+ "See [documentation](https://docs.streamlit.io/develop/api-reference/layout/st.columns) "
248
282
  "for more information."
249
283
  )
250
284
 
@@ -456,9 +490,11 @@ class LayoutsMixin:
456
490
  Unsupported elements are unwrapped so only their children (text contents) render.
457
491
  Display unsupported elements as literal characters by
458
492
  backslash-escaping them. E.g. ``1\. Not an ordered list``.
493
+
459
494
  expanded : bool
460
495
  If True, initializes the expander in "expanded" state. Defaults to
461
496
  False (collapsed).
497
+
462
498
  icon : str, None
463
499
  An optional emoji or icon to display next to the expander label. If ``icon``
464
500
  is ``None`` (default), no icon is displayed. If ``icon`` is a
@@ -1038,7 +1038,7 @@ def ImageColumn(
1038
1038
  The cell values need to be one of:
1039
1039
 
1040
1040
  * A URL to fetch the image from. This can also be a relative URL of an image
1041
- deployed via `static file serving <https://docs.streamlit.io/library/advanced-features/static-file-serving>`_.
1041
+ deployed via `static file serving <https://docs.streamlit.io/develop/concepts/configuration/serving-static-files>`_.
1042
1042
  Note that you can NOT use an arbitrary local image if it is not available through
1043
1043
  a public URL.
1044
1044
  * A data URL containing an SVG XML like ``data:image/svg+xml;utf8,<svg xmlns=...</svg>``.
streamlit/elements/map.py CHANGED
@@ -112,7 +112,7 @@ class MapMixin:
112
112
 
113
113
  To get a token for yourself, create an account at https://mapbox.com.
114
114
  For more info on how to set config options, see
115
- https://docs.streamlit.io/library/advanced-features/configuration
115
+ https://docs.streamlit.io/develop/api-reference/configuration/config.toml.
116
116
 
117
117
  Parameters
118
118
  ----------
@@ -64,15 +64,17 @@ class MarkdownMixin:
64
64
  ``:blue-background[your text here]``.
65
65
 
66
66
  unsafe_allow_html : bool
67
- By default, any HTML tags found in the body will be escaped and
68
- therefore treated as pure text. This behavior may be turned off by
69
- setting this argument to True.
67
+ Whether to render HTML within ``body``. If this is ``False``
68
+ (default), any HTML tags found in ``body`` will be escaped and
69
+ therefore treated as raw text. If this is ``True``, any HTML
70
+ expressions within ``body`` will be rendered.
70
71
 
71
- That said, we *strongly advise against it*. It is hard to write
72
- secure HTML, so by using this argument you may be compromising your
73
- users' security. For more information, see:
72
+ Adding custom HTML to your app impacts safety, styling, and
73
+ maintainability.
74
74
 
75
- https://github.com/streamlit/streamlit/issues/152
75
+ .. note::
76
+ If you only want to insert HTML or CSS without Markdown text,
77
+ we recommend using ``st.html`` instead.
76
78
 
77
79
  help : str
78
80
  An optional tooltip that gets displayed next to the Markdown.
@@ -185,15 +187,17 @@ class MarkdownMixin:
185
187
  ``:blue-background[your text here]``.
186
188
 
187
189
  unsafe_allow_html : bool
188
- By default, any HTML tags found in strings will be escaped and
189
- therefore treated as pure text. This behavior may be turned off by
190
- setting this argument to True.
190
+ Whether to render HTML within ``body``. If this is ``False``
191
+ (default), any HTML tags found in ``body`` will be escaped and
192
+ therefore treated as raw text. If this is ``True``, any HTML
193
+ expressions within ``body`` will be rendered.
191
194
 
192
- That said, *we strongly advise against it*. It is hard to write secure
193
- HTML, so by using this argument you may be compromising your users'
194
- security. For more information, see:
195
+ Adding custom HTML to your app impacts safety, styling, and
196
+ maintainability.
195
197
 
196
- https://github.com/streamlit/streamlit/issues/152
198
+ .. note::
199
+ If you only want to insert HTML or CSS without Markdown text,
200
+ we recommend using ``st.html`` instead.
197
201
 
198
202
  help : str
199
203
  An optional tooltip that gets displayed next to the caption.
@@ -184,8 +184,11 @@ class PlotlyState(TypedDict, total=False):
184
184
 
185
185
  Attributes
186
186
  ----------
187
- selection : PlotlySelectionState
188
- The state of the ``on_select`` event.
187
+ selection : dict
188
+ The state of the ``on_select`` event. This attribure returns a
189
+ dictionary-like object that supports both key and attribute notation.
190
+ The attributes are described by the ``PlotlySelectionState`` dictionary
191
+ schema.
189
192
 
190
193
  Example
191
194
  -------
@@ -48,7 +48,7 @@ class ToastMixin:
48
48
 
49
49
  .. warning::
50
50
  ``st.toast`` is not compatible with Streamlit's `caching \
51
- <https://docs.streamlit.io/library/advanced-features/caching>`_ and
51
+ <https://docs.streamlit.io/develop/concepts/architecture/caching>`_ and
52
52
  cannot be called within a cached function.
53
53
 
54
54
  Parameters