streamlit-nightly 1.41.2.dev20250201__py2.py3-none-any.whl → 1.42.1.dev20250204__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 (183) hide show
  1. streamlit/auth_util.py +2 -1
  2. streamlit/commands/echo.py +4 -1
  3. streamlit/commands/execution_control.py +3 -1
  4. streamlit/commands/page_config.py +2 -1
  5. streamlit/config.py +56 -25
  6. streamlit/config_option.py +3 -3
  7. streamlit/connections/snowflake_connection.py +22 -10
  8. streamlit/connections/snowpark_connection.py +2 -1
  9. streamlit/connections/util.py +4 -1
  10. streamlit/dataframe_util.py +3 -8
  11. streamlit/delta_generator.py +1 -1
  12. streamlit/elements/alert.py +32 -4
  13. streamlit/elements/arrow.py +28 -15
  14. streamlit/elements/code.py +4 -3
  15. streamlit/elements/deck_gl_json_chart.py +3 -4
  16. streamlit/elements/form.py +22 -4
  17. streamlit/elements/heading.py +21 -6
  18. streamlit/elements/image.py +12 -3
  19. streamlit/elements/layouts.py +9 -4
  20. streamlit/elements/lib/built_in_chart_utils.py +1 -3
  21. streamlit/elements/lib/color_util.py +7 -6
  22. streamlit/elements/lib/column_config_utils.py +4 -3
  23. streamlit/elements/lib/column_types.py +100 -33
  24. streamlit/elements/lib/dicttools.py +4 -1
  25. streamlit/elements/lib/event_utils.py +2 -2
  26. streamlit/elements/lib/file_uploader_utils.py +4 -1
  27. streamlit/elements/lib/image_utils.py +5 -4
  28. streamlit/elements/lib/options_selector_utils.py +4 -1
  29. streamlit/elements/lib/pandas_styler_utils.py +2 -1
  30. streamlit/elements/lib/policies.py +3 -1
  31. streamlit/elements/lib/utils.py +1 -1
  32. streamlit/elements/map.py +3 -1
  33. streamlit/elements/markdown.py +21 -7
  34. streamlit/elements/media.py +2 -2
  35. streamlit/elements/metric.py +8 -4
  36. streamlit/elements/plotly_chart.py +4 -5
  37. streamlit/elements/spinner.py +25 -3
  38. streamlit/elements/text.py +7 -2
  39. streamlit/elements/vega_charts.py +26 -22
  40. streamlit/elements/widgets/audio_input.py +8 -4
  41. streamlit/elements/widgets/button.py +29 -12
  42. streamlit/elements/widgets/button_group.py +29 -13
  43. streamlit/elements/widgets/camera_input.py +8 -4
  44. streamlit/elements/widgets/chat.py +1 -3
  45. streamlit/elements/widgets/checkbox.py +16 -8
  46. streamlit/elements/widgets/color_picker.py +8 -4
  47. streamlit/elements/widgets/data_editor.py +10 -14
  48. streamlit/elements/widgets/file_uploader.py +12 -6
  49. streamlit/elements/widgets/multiselect.py +10 -5
  50. streamlit/elements/widgets/number_input.py +8 -4
  51. streamlit/elements/widgets/radio.py +11 -5
  52. streamlit/elements/widgets/select_slider.py +12 -8
  53. streamlit/elements/widgets/selectbox.py +11 -5
  54. streamlit/elements/widgets/slider.py +19 -17
  55. streamlit/elements/widgets/text_widgets.py +16 -8
  56. streamlit/elements/widgets/time_widgets.py +21 -15
  57. streamlit/elements/write.py +60 -43
  58. streamlit/errors.py +1 -2
  59. streamlit/external/langchain/streamlit_callback_handler.py +3 -3
  60. streamlit/hello/animation_demo.py +1 -1
  61. streamlit/material_icon_names.py +1 -1
  62. streamlit/proto/NewSession_pb2.py +16 -16
  63. streamlit/proto/NewSession_pb2.pyi +30 -3
  64. streamlit/runtime/app_session.py +15 -15
  65. streamlit/runtime/caching/cached_message_replay.py +2 -1
  66. streamlit/runtime/caching/hashing.py +3 -2
  67. streamlit/runtime/context.py +2 -1
  68. streamlit/runtime/forward_msg_cache.py +3 -1
  69. streamlit/runtime/memory_session_storage.py +4 -1
  70. streamlit/runtime/memory_uploaded_file_manager.py +4 -1
  71. streamlit/runtime/runtime.py +6 -4
  72. streamlit/runtime/scriptrunner/script_runner.py +4 -3
  73. streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -3
  74. streamlit/runtime/secrets.py +1 -5
  75. streamlit/runtime/state/common.py +2 -4
  76. streamlit/runtime/state/query_params.py +2 -1
  77. streamlit/runtime/state/query_params_proxy.py +2 -1
  78. streamlit/runtime/state/safe_session_state.py +3 -1
  79. streamlit/runtime/state/session_state.py +2 -5
  80. streamlit/runtime/state/session_state_proxy.py +2 -1
  81. streamlit/runtime/uploaded_file_manager.py +3 -1
  82. streamlit/runtime/websocket_session_manager.py +8 -8
  83. streamlit/static/index.html +2 -2
  84. streamlit/static/static/css/{index.mUTQuMqR.css → index.DpJG_94W.css} +1 -1
  85. streamlit/static/static/js/{FileDownload.esm.Cf3bITtP.js → FileDownload.esm.CuayiK6T.js} +1 -1
  86. streamlit/static/static/js/FileDropzone.CvXoxIUm.js +5 -0
  87. streamlit/static/static/js/{FormClearHelper.BgwPD1tD.js → FormClearHelper.DpwWkrvV.js} +1 -1
  88. streamlit/static/static/js/{Hooks.BMaXaj11.js → Hooks.BQiFiHd5.js} +1 -1
  89. streamlit/static/static/js/{InputInstructions.qlsk9gvt.js → InputInstructions.CypmdrYz.js} +1 -1
  90. streamlit/static/static/js/ProgressBar.DfR4HyQR.js +2 -0
  91. streamlit/static/static/js/{RenderInPortalIfExists.Blpdplqk.js → RenderInPortalIfExists.D6u3szcn.js} +1 -1
  92. streamlit/static/static/js/{Toolbar.DMhyNpv2.js → Toolbar.D6p42Hno.js} +1 -1
  93. streamlit/static/static/js/axios.upsvKRUO.js +6 -0
  94. streamlit/static/static/js/{base-input.DyTEaESI.js → base-input.B5AcLp6p.js} +4 -4
  95. streamlit/static/static/js/{createSuper.B3rIhdpQ.js → createSuper.DNzaJgi-.js} +1 -1
  96. streamlit/static/static/js/{data-grid-overlay-editor.C9Q9Gy4e.js → data-grid-overlay-editor.CKACfVZL.js} +1 -1
  97. streamlit/static/static/js/{downloader.BAMiKd1n.js → downloader.D6HV3a60.js} +1 -1
  98. streamlit/static/static/js/{es6.D82pr6dy.js → es6.UQDWlCyE.js} +2 -2
  99. streamlit/static/static/js/{iframeResizer.contentWindow.CJwxqR7x.js → iframeResizer.contentWindow.DQ-TFrBp.js} +1 -1
  100. streamlit/static/static/js/{index.B7J6suR-.js → index.2EE80u0h.js} +200 -200
  101. streamlit/static/static/js/{index.CoE1gpPQ.js → index.B96fHK2A.js} +1 -1
  102. streamlit/static/static/js/index.BAFGiIHm.js +1 -0
  103. streamlit/static/static/js/index.BPNlEjgz.js +1 -0
  104. streamlit/static/static/js/{index.C4kPuKr4.js → index.BPmrb-47.js} +1 -1
  105. streamlit/static/static/js/{index.BM_J1KkD.js → index.BQEIBi4n.js} +1 -1
  106. streamlit/static/static/js/index.BUGQmWUV.js +3 -0
  107. streamlit/static/static/js/index.BXmBj7MJ.js +1 -0
  108. streamlit/static/static/js/{index.5JFTbX2J.js → index.BY8YeKF1.js} +1 -1
  109. streamlit/static/static/js/{index.CF4stbIZ.js → index.BdVr8Tta.js} +1 -1
  110. streamlit/static/static/js/{index.CjFbbEE0.js → index.BghvoEVe.js} +1 -1
  111. streamlit/static/static/js/{index.8Q56Jjmk.js → index.BiMrOUpK.js} +1 -1
  112. streamlit/static/static/js/{index.yp4f0OMe.js → index.BiybRa0I.js} +2 -2
  113. streamlit/static/static/js/index.Bm7Vkuba.js +73 -0
  114. streamlit/static/static/js/{index.BZvQkTCS.js → index.BuyK2IsW.js} +1 -1
  115. streamlit/static/static/js/index.ByH1pn5_.js +1 -0
  116. streamlit/static/static/js/{index.zlHOKWDA.js → index.C8zZSMvD.js} +1 -1
  117. streamlit/static/static/js/index.CAuJtYES.js +1 -0
  118. streamlit/static/static/js/{index.Y84nTPW2.js → index.CEdHQ1ob.js} +1 -1
  119. streamlit/static/static/js/{index.CqGcWpm5.js → index.CJ-t5S6T.js} +2 -2
  120. streamlit/static/static/js/{index.BdlaxG49.js → index.CKOdbWxq.js} +1 -1
  121. streamlit/static/static/js/index.CSgG8OVN.js +1 -0
  122. streamlit/static/static/js/index.CX9gqq2L.js +1 -0
  123. streamlit/static/static/js/{index.TPHsScPF.js → index.CgVoYKAP.js} +1 -1
  124. streamlit/static/static/js/{index.D9yF6cxC.js → index.ChrjN8GY.js} +1 -1
  125. streamlit/static/static/js/{index.NbimJbgq.js → index.CrMtUJsu.js} +6 -6
  126. streamlit/static/static/js/index.D4SMJhY1.js +1 -0
  127. streamlit/static/static/js/index.D7BxtE4u.js +1 -0
  128. streamlit/static/static/js/{index.P5kx9um8.js → index.DB_dBVfZ.js} +5 -5
  129. streamlit/static/static/js/{index.BLCqXxIG.js → index.DMKXUbO6.js} +1 -1
  130. streamlit/static/static/js/index.DaoBv396.js +1 -0
  131. streamlit/static/static/js/{index.B3Wxz7wG.js → index.DkV6k6Ng.js} +1 -1
  132. streamlit/static/static/js/{index.BcAjRRAZ.js → index.DqZZoWyt.js} +1 -1
  133. streamlit/static/static/js/index.Dr6DSYcq.js +1 -0
  134. streamlit/static/static/js/{index.BdEYCAFh.js → index.Epl2r08f.js} +1 -1
  135. streamlit/static/static/js/{index.CC5oiyoV.js → index.ndVWhafL.js} +2 -2
  136. streamlit/static/static/js/{index.DiZyaYeV.js → index.wW-pPvtW.js} +3 -3
  137. streamlit/static/static/js/{input.DRyjjTTH.js → input.CxqdG-sh.js} +2 -2
  138. streamlit/static/static/js/{memory.C98yjNkk.js → memory.DuSk7Eex.js} +1 -1
  139. streamlit/static/static/js/{mergeWith.CLihEflw.js → mergeWith.DrxB1Sj4.js} +1 -1
  140. streamlit/static/static/js/{number-overlay-editor.DozQhDJj.js → number-overlay-editor.DBc0yndt.js} +1 -1
  141. streamlit/static/static/js/{possibleConstructorReturn.DJ7-JsJc.js → possibleConstructorReturn.ZdYWHeG3.js} +1 -1
  142. streamlit/static/static/js/{sandbox.0Tj4C46D.js → sandbox.D3L4CYjG.js} +1 -1
  143. streamlit/static/static/js/{textarea.CUrV8-V3.js → textarea.CSafh28v.js} +2 -2
  144. streamlit/static/static/js/{timepicker.DEu3fwJe.js → timepicker.C-pwkiaT.js} +4 -4
  145. streamlit/static/static/js/{toConsumableArray.C71OtXzK.js → toConsumableArray.DyCVskz5.js} +1 -1
  146. streamlit/static/static/js/{uniqueId.CndDhnid.js → uniqueId.BODM2vTk.js} +1 -1
  147. streamlit/static/static/js/useBasicWidgetState.DQUiM2dz.js +1 -0
  148. streamlit/static/static/js/{useOnInputChange.CvHbHWmy.js → useOnInputChange.Ccjd55xn.js} +1 -1
  149. streamlit/static/static/js/{withFullScreenWrapper.BLLyDFUF.js → withFullScreenWrapper.CneUoXNE.js} +1 -1
  150. streamlit/static/static/media/MaterialSymbols-Rounded.DcZbplWk.woff2 +0 -0
  151. streamlit/testing/v1/app_test.py +3 -1
  152. streamlit/testing/v1/element_tree.py +3 -4
  153. streamlit/testing/v1/local_script_runner.py +3 -3
  154. streamlit/type_util.py +11 -8
  155. streamlit/user_info.py +2 -3
  156. streamlit/watcher/path_watcher.py +4 -4
  157. streamlit/web/server/authlib_tornado_integration.py +3 -1
  158. streamlit/web/server/browser_websocket_handler.py +3 -1
  159. streamlit/web/server/routes.py +4 -1
  160. streamlit/web/server/server.py +2 -1
  161. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/METADATA +1 -2
  162. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/RECORD +166 -165
  163. streamlit/static/static/js/FileDropzone.B8wCqKiM.js +0 -5
  164. streamlit/static/static/js/ProgressBar.Di2oT-20.js +0 -2
  165. streamlit/static/static/js/index.B79cf7gS.js +0 -1
  166. streamlit/static/static/js/index.BBPZ3wsr.js +0 -1
  167. streamlit/static/static/js/index.BKahTKEx.js +0 -3
  168. streamlit/static/static/js/index.CSGfgCnQ.js +0 -1
  169. streamlit/static/static/js/index.CYMgsYSm.js +0 -1
  170. streamlit/static/static/js/index.CZjnqbcd.js +0 -73
  171. streamlit/static/static/js/index.C_4BuzGH.js +0 -1
  172. streamlit/static/static/js/index.CjiPq39N.js +0 -1
  173. streamlit/static/static/js/index.CjuTYYFG.js +0 -1
  174. streamlit/static/static/js/index.CuH7mftz.js +0 -1
  175. streamlit/static/static/js/index.DFJg1zHB.js +0 -1
  176. streamlit/static/static/js/index.Dm3nmdhh.js +0 -1
  177. streamlit/static/static/js/index.rrDohWOh.js +0 -1
  178. streamlit/static/static/js/useBasicWidgetState.DXLMTaiS.js +0 -1
  179. streamlit/static/static/media/MaterialSymbols-Rounded.DzyB5T7Y.woff2 +0 -0
  180. {streamlit_nightly-1.41.2.dev20250201.data → streamlit_nightly-1.42.1.dev20250204.data}/scripts/streamlit.cmd +0 -0
  181. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/WHEEL +0 -0
  182. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/entry_points.txt +0 -0
  183. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/top_level.txt +0 -0
@@ -16,11 +16,14 @@ from __future__ import annotations
16
16
 
17
17
  import contextlib
18
18
  import threading
19
- from typing import Iterator
19
+ from typing import TYPE_CHECKING
20
20
 
21
21
  import streamlit as st
22
22
  from streamlit.runtime.scriptrunner import add_script_run_ctx
23
23
 
24
+ if TYPE_CHECKING:
25
+ from collections.abc import Iterator
26
+
24
27
 
25
28
  @contextlib.contextmanager
26
29
  def spinner(
@@ -34,9 +37,23 @@ def spinner(
34
37
  Parameters
35
38
  ----------
36
39
  text : str
37
- The text to display next to the spinner. Defaults to "In progress...".
40
+ The text to display next to the spinner. This defaults to
41
+ ``"In progress..."``.
42
+
43
+ The text can optionally contain GitHub-flavored Markdown. Syntax
44
+ information can be found at: https://github.github.com/gfm.
45
+
46
+ See the ``body`` parameter of |st.markdown|_ for additional, supported
47
+ Markdown directives.
48
+
49
+ .. |st.markdown| replace:: ``st.markdown``
50
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
51
+
38
52
  show_time : bool
39
- Whether to show the elapsed time next to the spinner text. Defaults to False.
53
+ Whether to show the elapsed time next to the spinner text. If this is
54
+ ``False`` (default), no time is displayed. If this is ``True``,
55
+ elapsed time is displayed with a precision of 0.1 seconds. The time
56
+ format is not configurable.
40
57
 
41
58
  Example
42
59
  -------
@@ -46,6 +63,11 @@ def spinner(
46
63
  >>> with st.spinner("Wait for it...", show_time=True):
47
64
  >>> time.sleep(5)
48
65
  >>> st.success("Done!")
66
+ >>> st.button("Rerun")
67
+
68
+ .. output ::
69
+ https://doc-spinner.streamlit.app/
70
+ height: 210px
49
71
 
50
72
  """
51
73
  from streamlit.proto.Spinner_pb2 import Spinner as SpinnerProto
@@ -45,8 +45,13 @@ class TextMixin:
45
45
  body : str
46
46
  The string to display.
47
47
 
48
- help : str
49
- An optional tooltip that gets displayed next to the text.
48
+ help : str or None
49
+ A tooltip that gets displayed next to the text. If this is ``None``
50
+ (default), no tooltip is displayed.
51
+
52
+ The tooltip can optionally contain GitHub-flavored Markdown,
53
+ including the Markdown directives described in the ``body``
54
+ parameter of ``st.markdown``.
50
55
 
51
56
  Example
52
57
  -------
@@ -25,9 +25,7 @@ from typing import (
25
25
  TYPE_CHECKING,
26
26
  Any,
27
27
  Final,
28
- Iterable,
29
28
  Literal,
30
- Sequence,
31
29
  TypedDict,
32
30
  Union,
33
31
  cast,
@@ -59,6 +57,8 @@ from streamlit.runtime.state import WidgetCallback, register_widget
59
57
  from streamlit.util import HASHLIB_KWARGS
60
58
 
61
59
  if TYPE_CHECKING:
60
+ from collections.abc import Iterable, Sequence
61
+
62
62
  import altair as alt
63
63
 
64
64
  from streamlit.dataframe_util import Data
@@ -1523,16 +1523,18 @@ class VegaChartsMixin:
1523
1523
  descriptions.
1524
1524
 
1525
1525
  use_container_width : bool or None
1526
- Whether to override the figure's native width with the width of
1527
- the parent container. If ``use_container_width`` is None (default),
1528
- Streamlit will set it to True for all charts except for facet,
1529
- horizontal concatenation, and repeat charts (note that for these chart
1530
- types, ``use_container_width=True`` doesn't work properly). If
1531
- ``use_container_width`` is ``True``, Streamlit sets the width of the
1532
- figure to match the width of the parent container. If ``use_container_width``
1533
- is ``False``, Streamlit sets the width of the chart to fit its contents
1534
- according to the plotting library, up to the width of the parent
1535
- container.
1526
+ Whether to override the chart's native width with the width of
1527
+ the parent container. This can be one of the following:
1528
+
1529
+ - ``None`` (default): Streamlit will use the parent container's
1530
+ width for all charts except those with known incompatibility
1531
+ (``altair.Facet``, ``altair.HConcatChart``, and
1532
+ ``altair.RepeatChart``).
1533
+ - ``True``: Streamlit sets the width of the chart to match the
1534
+ width of the parent container.
1535
+ - ``False``: Streamlit sets the width of the chart to fit its
1536
+ contents according to the plotting library, up to the width of
1537
+ the parent container.
1536
1538
 
1537
1539
  theme : "streamlit" or None
1538
1540
  The theme of the chart. If ``theme`` is ``"streamlit"`` (default),
@@ -1689,16 +1691,18 @@ class VegaChartsMixin:
1689
1691
  https://vega.github.io/vega-lite/docs/ for more info.
1690
1692
 
1691
1693
  use_container_width : bool or None
1692
- Whether to override the figure's native width with the width of
1693
- the parent container. If ``use_container_width`` is None (default),
1694
- Streamlit will set it to True for all charts except for facet,
1695
- horizontal concatenation, and repeat charts (note that for these chart
1696
- types, ``use_container_width=True`` doesn't work properly). If
1697
- ``use_container_width`` is ``True``, Streamlit sets the width of the
1698
- figure to match the width of the parent container. If ``use_container_width``
1699
- is ``False``, Streamlit sets the width of the chart to fit its contents
1700
- according to the plotting library, up to the width of the parent
1701
- container.
1694
+ Whether to override the chart's native width with the width of
1695
+ the parent container. This can be one of the following:
1696
+
1697
+ - ``None`` (default): Streamlit will use the parent container's
1698
+ width for all charts except those with known incompatibility
1699
+ (``altair.Facet``, ``altair.HConcatChart``, and
1700
+ ``altair.RepeatChart``).
1701
+ - ``True``: Streamlit sets the width of the chart to match the
1702
+ width of the parent container.
1703
+ - ``False``: Streamlit sets the width of the chart to fit its
1704
+ contents according to the plotting library, up to the width of
1705
+ the parent container.
1702
1706
 
1703
1707
  theme : "streamlit" or None
1704
1708
  The theme of the chart. If ``theme`` is ``"streamlit"`` (default),
@@ -131,10 +131,14 @@ class AudioInputMixin:
131
131
  If this is omitted, a key will be generated for the widget
132
132
  based on its content. No two widgets may have the same key.
133
133
 
134
- help : str
135
- An optional tooltip that gets displayed next to the widget label.
136
- Streamlit only displays the tooltip when
137
- ``label_visibility="visible"``.
134
+ help : str or None
135
+ A tooltip that gets displayed next to the widget label. Streamlit
136
+ only displays the tooltip when ``label_visibility="visible"``. If
137
+ this is ``None`` (default), no tooltip is displayed.
138
+
139
+ The tooltip can optionally contain GitHub-flavored Markdown,
140
+ including the Markdown directives described in the ``body``
141
+ parameter of ``st.markdown``.
138
142
 
139
143
  on_change : callable
140
144
  An optional callback invoked when this audio input's value
@@ -125,9 +125,14 @@ class ButtonMixin:
125
125
  An optional string or integer to use as the unique key for the widget.
126
126
  If this is omitted, a key will be generated for the widget
127
127
  based on its content. No two widgets may have the same key.
128
- help : str
129
- An optional tooltip that gets displayed when the button is
130
- hovered over.
128
+
129
+ help : str or None
130
+ A tooltip that gets displayed when the button is hovered over. If
131
+ this is ``None`` (default), no tooltip is displayed.
132
+
133
+ The tooltip can optionally contain GitHub-flavored Markdown,
134
+ including the Markdown directives described in the ``body``
135
+ parameter of ``st.markdown``.
131
136
 
132
137
  on_click : callable
133
138
  An optional callback invoked when this button is clicked.
@@ -321,9 +326,13 @@ class ButtonMixin:
321
326
  If this is omitted, a key will be generated for the widget
322
327
  based on its content. No two widgets may have the same key.
323
328
 
324
- help : str
325
- An optional tooltip that gets displayed when the button is
326
- hovered over.
329
+ help : str or None
330
+ A tooltip that gets displayed when the button is hovered over. If
331
+ this is ``None`` (default), no tooltip is displayed.
332
+
333
+ The tooltip can optionally contain GitHub-flavored Markdown,
334
+ including the Markdown directives described in the ``body``
335
+ parameter of ``st.markdown``.
327
336
 
328
337
  on_click : callable
329
338
  An optional callback invoked when this button is clicked.
@@ -498,9 +507,13 @@ class ButtonMixin:
498
507
  url : str
499
508
  The url to be opened on user click
500
509
 
501
- help : str
502
- An optional tooltip that gets displayed when the button is
503
- hovered over.
510
+ help : str or None
511
+ A tooltip that gets displayed when the button is hovered over. If
512
+ this is ``None`` (default), no tooltip is displayed.
513
+
514
+ The tooltip can optionally contain GitHub-flavored Markdown,
515
+ including the Markdown directives described in the ``body``
516
+ parameter of ``st.markdown``.
504
517
 
505
518
  type : "primary", "secondary", or "tertiary"
506
519
  An optional string that specifies the button type. This can be one
@@ -634,9 +647,13 @@ class ButtonMixin:
634
647
  <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
635
648
  font library.
636
649
 
637
- help : str
638
- An optional tooltip that gets displayed when the link is
639
- hovered over.
650
+ help : str or None
651
+ A tooltip that gets displayed when the link is hovered over. If
652
+ this is ``None`` (default), no tooltip is displayed.
653
+
654
+ The tooltip can optionally contain GitHub-flavored Markdown,
655
+ including the Markdown directives described in the ``body``
656
+ parameter of ``st.markdown``.
640
657
 
641
658
  disabled : bool
642
659
  An optional boolean that disables the page link if set to ``True``.
@@ -14,6 +14,7 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
+ from collections.abc import Sequence
17
18
  from typing import (
18
19
  TYPE_CHECKING,
19
20
  Any,
@@ -21,7 +22,6 @@ from typing import (
21
22
  Final,
22
23
  Generic,
23
24
  Literal,
24
- Sequence,
25
25
  TypeVar,
26
26
  cast,
27
27
  overload,
@@ -471,7 +471,9 @@ class ButtonGroupMixin:
471
471
  Labels for the select options in an ``Iterable``. This can be a
472
472
  ``list``, ``set``, or anything supported by ``st.dataframe``. If
473
473
  ``options`` is dataframe-like, the first column will be used. Each
474
- label will be cast to ``str`` internally by default.
474
+ label will be cast to ``str`` internally by default and can
475
+ optionally contain GitHub-flavored Markdown, including the Markdown
476
+ directives described in the ``body`` parameter of ``st.markdown``.
475
477
 
476
478
  selection_mode: "single" or "multi"
477
479
  The selection mode for the widget. If this is ``"single"``
@@ -488,7 +490,9 @@ class ButtonGroupMixin:
488
490
  Function to modify the display of the options. It receives
489
491
  the raw option as an argument and should output the label to be
490
492
  shown for that option. This has no impact on the return value of
491
- the command.
493
+ the command. The output can optionally contain GitHub-flavored
494
+ Markdown, including the Markdown directives described in the
495
+ ``body`` parameter of ``st.markdown``.
492
496
 
493
497
  key: str or int
494
498
  An optional string or integer to use as the unique key for the widget.
@@ -496,10 +500,14 @@ class ButtonGroupMixin:
496
500
  based on its content. Multiple widgets of the same type may
497
501
  not share the same key.
498
502
 
499
- help: str
500
- An optional tooltip that gets displayed next to the widget label.
501
- Streamlit only displays the tooltip when
502
- ``label_visibility="visible"``.
503
+ help: str or None
504
+ A tooltip that gets displayed next to the widget label. Streamlit
505
+ only displays the tooltip when ``label_visibility="visible"``. If
506
+ this is ``None`` (default), no tooltip is displayed.
507
+
508
+ The tooltip can optionally contain GitHub-flavored Markdown,
509
+ including the Markdown directives described in the ``body``
510
+ parameter of ``st.markdown``.
503
511
 
504
512
  on_change: callable
505
513
  An optional callback invoked when this widget's value changes.
@@ -673,7 +681,9 @@ class ButtonGroupMixin:
673
681
  Labels for the select options in an ``Iterable``. This can be a
674
682
  ``list``, ``set``, or anything supported by ``st.dataframe``. If
675
683
  ``options`` is dataframe-like, the first column will be used. Each
676
- label will be cast to ``str`` internally by default.
684
+ label will be cast to ``str`` internally by default and can
685
+ optionally contain GitHub-flavored Markdown, including the Markdown
686
+ directives described in the ``body`` parameter of ``st.markdown``.
677
687
 
678
688
  selection_mode: "single" or "multi"
679
689
  The selection mode for the widget. If this is ``"single"``
@@ -690,7 +700,9 @@ class ButtonGroupMixin:
690
700
  Function to modify the display of the options. It receives
691
701
  the raw option as an argument and should output the label to be
692
702
  shown for that option. This has no impact on the return value of
693
- the command.
703
+ the command. The output can optionally contain GitHub-flavored
704
+ Markdown, including the Markdown directives described in the
705
+ ``body`` parameter of ``st.markdown``.
694
706
 
695
707
  key: str or int
696
708
  An optional string or integer to use as the unique key for the widget.
@@ -698,10 +710,14 @@ class ButtonGroupMixin:
698
710
  based on its content. Multiple widgets of the same type may
699
711
  not share the same key.
700
712
 
701
- help: str
702
- An optional tooltip that gets displayed next to the widget label.
703
- Streamlit only displays the tooltip when
704
- ``label_visibility="visible"``.
713
+ help: str or None
714
+ A tooltip that gets displayed next to the widget label. Streamlit
715
+ only displays the tooltip when ``label_visibility="visible"``. If
716
+ this is ``None`` (default), no tooltip is displayed.
717
+
718
+ The tooltip can optionally contain GitHub-flavored Markdown,
719
+ including the Markdown directives described in the ``body``
720
+ parameter of ``st.markdown``.
705
721
 
706
722
  on_change: callable
707
723
  An optional callback invoked when this widget's value changes.
@@ -127,10 +127,14 @@ class CameraInputMixin:
127
127
  If this is omitted, a key will be generated for the widget
128
128
  based on its content. No two widgets may have the same key.
129
129
 
130
- help : str
131
- An optional tooltip that gets displayed next to the widget label.
132
- Streamlit only displays the tooltip when
133
- ``label_visibility="visible"``.
130
+ help : str or None
131
+ A tooltip that gets displayed next to the widget label. Streamlit
132
+ only displays the tooltip when ``label_visibility="visible"``. If
133
+ this is ``None`` (default), no tooltip is displayed.
134
+
135
+ The tooltip can optionally contain GitHub-flavored Markdown,
136
+ including the Markdown directives described in the ``body``
137
+ parameter of ``st.markdown``.
134
138
 
135
139
  on_change : callable
136
140
  An optional callback invoked when this camera_input's value
@@ -14,15 +14,13 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
+ from collections.abc import Iterator, MutableMapping, Sequence
17
18
  from dataclasses import dataclass
18
19
  from enum import Enum
19
20
  from typing import (
20
21
  TYPE_CHECKING,
21
22
  Any,
22
- Iterator,
23
23
  Literal,
24
- MutableMapping,
25
- Sequence,
26
24
  cast,
27
25
  overload,
28
26
  )
@@ -105,10 +105,14 @@ class CheckboxMixin:
105
105
  If this is omitted, a key will be generated for the widget
106
106
  based on its content. No two widgets may have the same key.
107
107
 
108
- help : str
109
- An optional tooltip that gets displayed next to the widget label.
110
- Streamlit only displays the tooltip when
111
- ``label_visibility="visible"``.
108
+ help : str or None
109
+ A tooltip that gets displayed next to the widget label. Streamlit
110
+ only displays the tooltip when ``label_visibility="visible"``. If
111
+ this is ``None`` (default), no tooltip is displayed.
112
+
113
+ The tooltip can optionally contain GitHub-flavored Markdown,
114
+ including the Markdown directives described in the ``body``
115
+ parameter of ``st.markdown``.
112
116
 
113
117
  on_change : callable
114
118
  An optional callback invoked when this checkbox's value changes.
@@ -212,10 +216,14 @@ class CheckboxMixin:
212
216
  If this is omitted, a key will be generated for the widget
213
217
  based on its content. No two widgets may have the same key.
214
218
 
215
- help : str
216
- An optional tooltip that gets displayed next to the widget label.
217
- Streamlit only displays the tooltip when
218
- ``label_visibility="visible"``.
219
+ help : str or None
220
+ A tooltip that gets displayed next to the widget label. Streamlit
221
+ only displays the tooltip when ``label_visibility="visible"``. If
222
+ this is ``None`` (default), no tooltip is displayed.
223
+
224
+ The tooltip can optionally contain GitHub-flavored Markdown,
225
+ including the Markdown directives described in the ``body``
226
+ parameter of ``st.markdown``.
219
227
 
220
228
  on_change : callable
221
229
  An optional callback invoked when this toggle's value changes.
@@ -107,10 +107,14 @@ class ColorPickerMixin:
107
107
  If this is omitted, a key will be generated for the widget
108
108
  based on its content. No two widgets may have the same key.
109
109
 
110
- help : str
111
- An optional tooltip that gets displayed next to the widget label.
112
- Streamlit only displays the tooltip when
113
- ``label_visibility="visible"``.
110
+ help : str or None
111
+ A tooltip that gets displayed next to the widget label. Streamlit
112
+ only displays the tooltip when ``label_visibility="visible"``. If
113
+ this is ``None`` (default), no tooltip is displayed.
114
+
115
+ The tooltip can optionally contain GitHub-flavored Markdown,
116
+ including the Markdown directives described in the ``body``
117
+ parameter of ``st.markdown``.
114
118
 
115
119
  on_change : callable
116
120
  An optional callback invoked when this color_picker's value
@@ -20,14 +20,8 @@ from decimal import Decimal
20
20
  from typing import (
21
21
  TYPE_CHECKING,
22
22
  Any,
23
- Dict,
24
23
  Final,
25
- Iterable,
26
- List,
27
24
  Literal,
28
- Mapping,
29
- Set,
30
- Tuple,
31
25
  TypedDict,
32
26
  TypeVar,
33
27
  Union,
@@ -70,6 +64,8 @@ from streamlit.type_util import is_type
70
64
  from streamlit.util import calc_md5
71
65
 
72
66
  if TYPE_CHECKING:
67
+ from collections.abc import Iterable, Mapping
68
+
73
69
  import numpy as np
74
70
  import pandas as pd
75
71
  import pyarrow as pa
@@ -85,10 +81,10 @@ EditableData = TypeVar(
85
81
  "EditableData",
86
82
  bound=Union[
87
83
  dataframe_util.DataFrameGenericAlias[Any], # covers DataFrame and Series
88
- Tuple[Any],
89
- List[Any],
90
- Set[Any],
91
- Dict[str, Any],
84
+ tuple[Any],
85
+ list[Any],
86
+ set[Any],
87
+ dict[str, Any],
92
88
  # TODO(lukasmasuch): Add support for np.ndarray
93
89
  # but it is not possible with np.ndarray.
94
90
  # NDArray[Any] works, but is only available in numpy>1.20.
@@ -106,10 +102,10 @@ DataTypes: TypeAlias = Union[
106
102
  "Styler",
107
103
  "pa.Table",
108
104
  "np.ndarray[Any, np.dtype[np.float64]]",
109
- Tuple[Any],
110
- List[Any],
111
- Set[Any],
112
- Dict[str, Any],
105
+ tuple[Any],
106
+ list[Any],
107
+ set[Any],
108
+ dict[str, Any],
113
109
  ]
114
110
 
115
111
 
@@ -16,7 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  from dataclasses import dataclass
18
18
  from textwrap import dedent
19
- from typing import TYPE_CHECKING, List, Literal, Sequence, Union, cast, overload
19
+ from typing import TYPE_CHECKING, Literal, Union, cast, overload
20
20
 
21
21
  from typing_extensions import TypeAlias
22
22
 
@@ -48,12 +48,14 @@ from streamlit.runtime.state import (
48
48
  from streamlit.runtime.uploaded_file_manager import DeletedFile, UploadedFile
49
49
 
50
50
  if TYPE_CHECKING:
51
+ from collections.abc import Sequence
52
+
51
53
  from streamlit.delta_generator import DeltaGenerator
52
54
 
53
55
  SomeUploadedFiles: TypeAlias = Union[
54
56
  UploadedFile,
55
57
  DeletedFile,
56
- List[Union[UploadedFile, DeletedFile]],
58
+ list[Union[UploadedFile, DeletedFile]],
57
59
  None,
58
60
  ]
59
61
 
@@ -276,10 +278,14 @@ class FileUploaderMixin:
276
278
  If this is omitted, a key will be generated for the widget
277
279
  based on its content. No two widgets may have the same key.
278
280
 
279
- help : str
280
- An optional tooltip that gets displayed next to the widget label.
281
- Streamlit only displays the tooltip when
282
- ``label_visibility="visible"``.
281
+ help : str or None
282
+ A tooltip that gets displayed next to the widget label. Streamlit
283
+ only displays the tooltip when ``label_visibility="visible"``. If
284
+ this is ``None`` (default), no tooltip is displayed.
285
+
286
+ The tooltip can optionally contain GitHub-flavored Markdown,
287
+ including the Markdown directives described in the ``body``
288
+ parameter of ``st.markdown``.
283
289
 
284
290
  on_change : callable
285
291
  An optional callback invoked when this file_uploader's value
@@ -14,9 +14,10 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
+ from collections.abc import Sequence
17
18
  from dataclasses import dataclass, field
18
19
  from textwrap import dedent
19
- from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast
20
+ from typing import TYPE_CHECKING, Any, Callable, Generic, cast
20
21
 
21
22
  from streamlit.dataframe_util import OptionSequence
22
23
  from streamlit.elements.lib.form_utils import current_form_id
@@ -167,10 +168,14 @@ class MultiSelectMixin:
167
168
  If this is omitted, a key will be generated for the widget
168
169
  based on its content. No two widgets may have the same key.
169
170
 
170
- help: str
171
- An optional tooltip that gets displayed next to the widget label.
172
- Streamlit only displays the tooltip when
173
- ``label_visibility="visible"``.
171
+ help: str or None
172
+ A tooltip that gets displayed next to the widget label. Streamlit
173
+ only displays the tooltip when ``label_visibility="visible"``. If
174
+ this is ``None`` (default), no tooltip is displayed.
175
+
176
+ The tooltip can optionally contain GitHub-flavored Markdown,
177
+ including the Markdown directives described in the ``body``
178
+ parameter of ``st.markdown``.
174
179
 
175
180
  on_change: callable
176
181
  An optional callback invoked when this widget's value changes.
@@ -251,10 +251,14 @@ class NumberInputMixin:
251
251
  If this is omitted, a key will be generated for the widget
252
252
  based on its content. No two widgets may have the same key.
253
253
 
254
- help : str
255
- An optional tooltip that gets displayed next to the widget label.
256
- Streamlit only displays the tooltip when
257
- ``label_visibility="visible"``.
254
+ help : str or None
255
+ A tooltip that gets displayed next to the widget label. Streamlit
256
+ only displays the tooltip when ``label_visibility="visible"``. If
257
+ this is ``None`` (default), no tooltip is displayed.
258
+
259
+ The tooltip can optionally contain GitHub-flavored Markdown,
260
+ including the Markdown directives described in the ``body``
261
+ parameter of ``st.markdown``.
258
262
 
259
263
  on_change : callable
260
264
  An optional callback invoked when this number_input's value changes.
@@ -16,7 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  from dataclasses import dataclass
18
18
  from textwrap import dedent
19
- from typing import TYPE_CHECKING, Any, Callable, Generic, Sequence, cast, overload
19
+ from typing import TYPE_CHECKING, Any, Callable, Generic, cast, overload
20
20
 
21
21
  from streamlit.dataframe_util import OptionSequence, convert_anything_to_list
22
22
  from streamlit.elements.lib.form_utils import current_form_id
@@ -50,6 +50,8 @@ from streamlit.type_util import (
50
50
  )
51
51
 
52
52
  if TYPE_CHECKING:
53
+ from collections.abc import Sequence
54
+
53
55
  from streamlit.delta_generator import DeltaGenerator
54
56
 
55
57
 
@@ -188,10 +190,14 @@ class RadioMixin:
188
190
  If this is omitted, a key will be generated for the widget
189
191
  based on its content. No two widgets may have the same key.
190
192
 
191
- help : str
192
- An optional tooltip that gets displayed next to the widget label.
193
- Streamlit only displays the tooltip when
194
- ``label_visibility="visible"``.
193
+ help : str or None
194
+ A tooltip that gets displayed next to the widget label. Streamlit
195
+ only displays the tooltip when ``label_visibility="visible"``. If
196
+ this is ``None`` (default), no tooltip is displayed.
197
+
198
+ The tooltip can optionally contain GitHub-flavored Markdown,
199
+ including the Markdown directives described in the ``body``
200
+ parameter of ``st.markdown``.
195
201
 
196
202
  on_change : callable
197
203
  An optional callback invoked when this radio's value changes.