streamlit-nightly 1.42.3.dev20250227__py2.py3-none-any.whl → 1.42.3.dev20250301__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 (85) hide show
  1. streamlit/elements/arrow.py +6 -5
  2. streamlit/elements/lib/column_types.py +101 -70
  3. streamlit/elements/widgets/button.py +13 -2
  4. streamlit/elements/widgets/data_editor.py +6 -5
  5. streamlit/elements/widgets/number_input.py +3 -2
  6. streamlit/elements/widgets/slider.py +11 -3
  7. streamlit/runtime/context.py +47 -2
  8. streamlit/static/index.html +1 -1
  9. streamlit/static/static/js/{FileDownload.esm.rdZtCw5-.js → FileDownload.esm.CUiEWbzl.js} +1 -1
  10. streamlit/static/static/js/{FileHelper.BztOEKJy.js → FileHelper.B6bBsK7b.js} +1 -1
  11. streamlit/static/static/js/{FormClearHelper.Drd1fMJc.js → FormClearHelper.B_9Ez6vr.js} +1 -1
  12. streamlit/static/static/js/{Hooks.DWd0hyk4.js → Hooks.VwVTTUgt.js} +1 -1
  13. streamlit/static/static/js/{InputInstructions.B7xrWTG0.js → InputInstructions.vmQUtJfB.js} +1 -1
  14. streamlit/static/static/js/{ProgressBar.CBgJiTH-.js → ProgressBar.CrEUq34O.js} +1 -1
  15. streamlit/static/static/js/{RenderInPortalIfExists.US28tQOn.js → RenderInPortalIfExists.uSIUxO87.js} +1 -1
  16. streamlit/static/static/js/{Toolbar.CAOt-xaL.js → Toolbar.DDSvrD0E.js} +1 -1
  17. streamlit/static/static/js/{base-input.CauNaJqr.js → base-input.JpWAqJ0N.js} +1 -1
  18. streamlit/static/static/js/{checkbox.ChzWCtre.js → checkbox.CWR-VT1j.js} +1 -1
  19. streamlit/static/static/js/{createSuper.D_39RJB6.js → createSuper.HcF5WnqF.js} +1 -1
  20. streamlit/static/static/js/{data-grid-overlay-editor.rIelkOVS.js → data-grid-overlay-editor.DminHUYw.js} +1 -1
  21. streamlit/static/static/js/{downloader.Dz5I28nG.js → downloader._SGckIiV.js} +1 -1
  22. streamlit/static/static/js/{es6.DwnEjMMn.js → es6.b4hv8be8.js} +2 -2
  23. streamlit/static/static/js/{iframeResizer.contentWindow.BRiRifwd.js → iframeResizer.contentWindow.BqakL47H.js} +1 -1
  24. streamlit/static/static/js/{index.DkKZlAsv.js → index.3M6TVRo2.js} +1 -1
  25. streamlit/static/static/js/{index.pvQjxG7y.js → index.B4fN2DMS.js} +1 -1
  26. streamlit/static/static/js/{index.CM12P2T1.js → index.B5U4WHdm.js} +2 -2
  27. streamlit/static/static/js/{index.BE6MTF-B.js → index.BFysNJg1.js} +3 -3
  28. streamlit/static/static/js/{index.Dj91melR.js → index.BL2LjKzZ.js} +1 -1
  29. streamlit/static/static/js/{index.YNWoT4uW.js → index.BLVbwbeW.js} +1 -1
  30. streamlit/static/static/js/{index.DWFLx6Tc.js → index.BV5mA8ty.js} +5 -5
  31. streamlit/static/static/js/{index.fP6rBxlc.js → index.BVLYWr2w.js} +1 -1
  32. streamlit/static/static/js/index.BWfK_Obw.js +203 -0
  33. streamlit/static/static/js/{index.CO3dZWKG.js → index.BXSIv1Yj.js} +1 -1
  34. streamlit/static/static/js/index.BgLbohq1.js +3855 -0
  35. streamlit/static/static/js/{index.DYUhWSq6.js → index.BhVVEe37.js} +1 -1
  36. streamlit/static/static/js/{index.CBre8Aui.js → index.BkDOb1MH.js} +1 -1
  37. streamlit/static/static/js/{index.D9rv1PQ0.js → index.C-MV6qmR.js} +1 -1
  38. streamlit/static/static/js/{index.DkgVNhWs.js → index.C2ti2ux-.js} +1 -1
  39. streamlit/static/static/js/{index.CoUzNoRf.js → index.C59Ya3CM.js} +1 -1
  40. streamlit/static/static/js/{index.CAHGh74D.js → index.C7GAgXnu.js} +1 -1
  41. streamlit/static/static/js/index.C88pvD_q.js +6 -0
  42. streamlit/static/static/js/{index.C_C365T5.js → index.CA_X6A4G.js} +1 -1
  43. streamlit/static/static/js/{index.CUz1_nAm.js → index.CAxOUw_O.js} +1 -1
  44. streamlit/static/static/js/{index.Db3jGJxa.js → index.Cb8hCZyO.js} +1 -1
  45. streamlit/static/static/js/{index.aL_kqyvR.js → index.CpN57BL8.js} +1 -1
  46. streamlit/static/static/js/{index.Dzp8iBkF.js → index.CpyxO9i-.js} +1 -1
  47. streamlit/static/static/js/{index.DfNAkKAr.js → index.CqU47T61.js} +114 -114
  48. streamlit/static/static/js/{index.ORHz8Y8P.js → index.Cr9buiVv.js} +8 -8
  49. streamlit/static/static/js/{index.CmYiLKNX.js → index.Cs86Rh1I.js} +1 -1
  50. streamlit/static/static/js/{index.DKuQg2D4.js → index.D4Nzp4K3.js} +1 -1
  51. streamlit/static/static/js/{index.wxpL02VY.js → index.D4vb0WQf.js} +1 -1
  52. streamlit/static/static/js/{index.DJvwxFLn.js → index.D6kHe3jN.js} +1 -1
  53. streamlit/static/static/js/{index.BWeYb5ES.js → index.D7yQTfz7.js} +1 -1
  54. streamlit/static/static/js/{index.Ct7MPsA3.js → index.Dev73dEg.js} +1 -1
  55. streamlit/static/static/js/{index.BrAW6bFJ.js → index.Dl9vrclR.js} +1 -1
  56. streamlit/static/static/js/{index.DgNQKEeQ.js → index.Dph-QYbt.js} +1 -1
  57. streamlit/static/static/js/{index.V3Vj2d9m.js → index.E5dz2muJ.js} +1 -1
  58. streamlit/static/static/js/{index.DIeegLbv.js → index.J3DKPewF.js} +1 -1
  59. streamlit/static/static/js/index.SYnyLAtV.js +12 -0
  60. streamlit/static/static/js/{index.D1K6NCBQ.js → index._Q_M1OIX.js} +1 -1
  61. streamlit/static/static/js/{index.BUdhIGhT.js → index.cVjFgmUG.js} +1 -1
  62. streamlit/static/static/js/{input.D_dn5-2t.js → input.Dfd0mQ2M.js} +1 -1
  63. streamlit/static/static/js/{memory.pnMTtWQR.js → memory.DFfwDfdX.js} +1 -1
  64. streamlit/static/static/js/{mergeWith.CRrYodeI.js → mergeWith.B3E2fSKt.js} +1 -1
  65. streamlit/static/static/js/{number-overlay-editor.C65GBS2P.js → number-overlay-editor.DG8NE_c_.js} +1 -1
  66. streamlit/static/static/js/{possibleConstructorReturn.BnQk7lq_.js → possibleConstructorReturn.CJ1f9cWL.js} +1 -1
  67. streamlit/static/static/js/{sandbox.CrxXt1li.js → sandbox.-T0hcQrx.js} +1 -1
  68. streamlit/static/static/js/{textarea.DiFyO5JY.js → textarea.CCPaMMRd.js} +1 -1
  69. streamlit/static/static/js/{timepicker.B1Y7LIk4.js → timepicker.BrQl1vN-.js} +2 -2
  70. streamlit/static/static/js/{toConsumableArray.BWpBUK-j.js → toConsumableArray.UwlRgC7o.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.7ecIUkUs.js → uniqueId.C5B1A1oI.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.deG0KPm0.js → useBasicWidgetState.Czrslgva.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.CQ7sD7CO.js → useOnInputChange.Dw8zLgsb.js} +1 -1
  74. streamlit/static/static/js/{withFullScreenWrapper.D0wnBu3k.js → withFullScreenWrapper.t6HIFyK0.js} +1 -1
  75. streamlit/user_info.py +3 -0
  76. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250301.dist-info}/METADATA +1 -1
  77. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250301.dist-info}/RECORD +81 -81
  78. streamlit/static/static/js/index.Bb4OB39A.js +0 -12
  79. streamlit/static/static/js/index.D2xM-XzG.js +0 -4074
  80. streamlit/static/static/js/index.DW_MHI2K.js +0 -6
  81. streamlit/static/static/js/index.LL2DLZZA.js +0 -201
  82. {streamlit_nightly-1.42.3.dev20250227.data → streamlit_nightly-1.42.3.dev20250301.data}/scripts/streamlit.cmd +0 -0
  83. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250301.dist-info}/WHEEL +0 -0
  84. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250301.dist-info}/entry_points.txt +0 -0
  85. {streamlit_nightly-1.42.3.dev20250227.dist-info → streamlit_nightly-1.42.3.dev20250301.dist-info}/top_level.txt +0 -0
@@ -331,10 +331,10 @@ class ArrowMixin:
331
331
 
332
332
  use_container_width : bool
333
333
  Whether to override ``width`` with the width of the parent
334
- container. If ``use_container_width`` is ``False``, Streamlit
335
- sets the dataframe's width according to ``width``. If
336
- ``use_container_width`` is ``True`` (default), Streamlit sets the
337
- width of the dataframe to match the width of the parent container.
334
+ container. If this is ``True`` (default), Streamlit sets the width
335
+ of the dataframe to match the width of the parent container. If
336
+ this is ``False``, Streamlit sets the dataframe's width according
337
+ to ``width``.
338
338
 
339
339
  hide_index : bool or None
340
340
  Whether to hide the index column(s). If ``hide_index`` is ``None``
@@ -421,7 +421,8 @@ class ArrowMixin:
421
421
 
422
422
  row_height : int or None
423
423
  The height of each row in the dataframe in pixels. If ``row_height``
424
- is ``None`` (default), Streamlit will use a default row height.
424
+ is ``None`` (default), Streamlit will use a default row height,
425
+ which fits one line of text.
425
426
 
426
427
  Returns
427
428
  -------
@@ -419,25 +419,28 @@ def NumberColumn(
419
419
 
420
420
  format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
421
421
  A format string controlling how numbers are displayed.
422
- Can be one of the following:
423
-
424
- - ``"plain"``: Shows the full number without any formatting (1234.567)
425
- - ``"localized"``: Shows the number in the default locale format (1,234.567)
426
- - ``"percent"``: Shows the number as a percentage (123456.70%)
427
- - ``"dollar"``: Shows the number as a dollar amount ($1,234.57)
428
- - ``"euro"``: Shows the number as a euro amount (1,234.57)
429
- - ``"accounting"``: Shows the number in an accounting format (1,234.00)
430
- - ``"compact"``: Shows the number in a compact format (1.2K)
431
- - ``"scientific"``: Shows the number in a scientific notation (1.235E3)
432
- - ``"engineering"``: Shows the number in an engineering notation (1.235E3)
433
- - printf-style format string: The following formatters are valid:
434
- ``%d``, ``%e``, ``%f``, ``%g``, ``%i``, ``%u``. You can also add
435
- prefixes and suffixes, e.g. ``"$ %.2f"`` to show a dollar prefix.
436
- - ``None`` (default): the numbers are formatted via a default formatter.
422
+ This can be one of the following values:
423
+
424
+ - ``None`` (default): Streamlit infers the formatting from the data.
425
+ - ``"plain"``: Show the full number without any formatting (e.g. "1234.567").
426
+ - ``"localized"``: Show the number in the default locale format (e.g. "1,234.567").
427
+ - ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
428
+ - ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
429
+ - ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
430
+ - ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
431
+ - ``"compact"``: Show the number in a compact format (e.g. "1.2K").
432
+ - ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
433
+ - ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
434
+ - printf-style format string: Format the number with a printf
435
+ specifier, like ``"%d"`` to show a signed integer (e.g. "1234") or
436
+ ``"%X"`` to show an unsigned hexidecimal integer (e.g. "4D2"). You
437
+ can also add prefixes and suffixes. To show British pounds, use
438
+ ``"£ %.2f"`` (e.g. "£ 1234.57"). For more information, see `sprint-js
439
+ <https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
437
440
 
438
- Number formatting from ``column_config`` always takes precedence over
439
- number formatting from ``pandas.Styler``. The number formatting does
440
- not impact the return value when used in ``st.data_editor``.
441
+ Formatting from ``column_config`` always takes precedence over
442
+ formatting from ``pandas.Styler``. The formatting does not impact the
443
+ return value when used in ``st.data_editor``.
441
444
 
442
445
  min_value: int, float, or None
443
446
  The minimum value that can be entered. If this is ``None`` (default),
@@ -1571,18 +1574,25 @@ def DatetimeColumn(
1571
1574
 
1572
1575
  format: str, "localized", "distance", "calendar", "iso8601", or None
1573
1576
  A format string controlling how datetimes are displayed.
1574
- Can be one of the following:
1575
-
1576
- - ``"localized"``: Shows the datetime in the default locale format.
1577
- - ``"distance"``: Shows the datetime in a relative format.
1578
- - ``"calendar"``: Shows the datetime in a calendar format.
1579
- - ``"iso8601"``: Shows the datetime in ISO 8601 format.
1580
- - A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
1581
- for available formats.
1582
- - ``None`` (default): uses ``YYYY-MM-DD HH:mm:ss`` as format.
1577
+ This can be one of the following values:
1578
+
1579
+ - ``None`` (default): Show the datetime in ``"YYYY-MM-DD HH:mm:ss"``
1580
+ format (e.g. "2025-03-04 20:00:00").
1581
+ - ``"localized"``: Show the datetime in the default locale format (e.g.
1582
+ "Mar 4, 2025, 12:00:00 PM" in the America/Los_Angeles timezone).
1583
+ - ``"distance"``: Show the datetime in a relative format (e.g.
1584
+ "a few seconds ago").
1585
+ - ``"calendar"``: Show the datetime in a calendar format (e.g.
1586
+ "Today at 8:00 PM").
1587
+ - ``"iso8601"``: Show the datetime in ISO 8601 format (e.g.
1588
+ "2025-03-04T20:00:00.000Z").
1589
+ - A momentJS format string: Format the datetime with a string, like
1590
+ ``"ddd ha"`` to show "Tue 8pm". For available formats, see
1591
+ `momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
1583
1592
 
1584
1593
  Formatting from ``column_config`` always takes precedence over
1585
- datetime formatting from ``pandas.Styler``.
1594
+ formatting from ``pandas.Styler``. The formatting does not impact the
1595
+ return value when used in ``st.data_editor``.
1586
1596
 
1587
1597
  min_value: datetime.datetime or None
1588
1598
  The minimum datetime that can be entered. If this is ``None``
@@ -1728,15 +1738,21 @@ def TimeColumn(
1728
1738
 
1729
1739
  format: str, "localized", "iso8601", or None
1730
1740
  A format string controlling how times are displayed.
1731
- Can be one of the following:
1732
- - ``"localized"``: Shows the time in the default locale format.
1733
- - ``"iso8601"``: Shows the time in ISO 8601 format.
1734
- - A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
1735
- for available formats.
1736
- - ``None`` (default): uses ``HH:mm:ss`` as format.
1741
+ This can be one of the following values:
1742
+
1743
+ - ``None`` (default): Show the time in ``"HH:mm:ss"`` format (e.g.
1744
+ "20:00:00").
1745
+ - ``"localized"``: Show the time in the default locale format (e.g.
1746
+ "12:00:00 PM" in the America/Los_Angeles timezone).
1747
+ - ``"iso8601"``: Show the time in ISO 8601 format (e.g.
1748
+ "20:00:00.000Z").
1749
+ - A momentJS format string: Format the time with a string, like
1750
+ ``"ha"`` to show "8pm". For available formats, see
1751
+ `momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
1737
1752
 
1738
- Time formatting from ``column_config`` always takes precedence over
1739
- time formatting from ``pandas.Styler``.
1753
+ Formatting from ``column_config`` always takes precedence over
1754
+ formatting from ``pandas.Styler``. The formatting does not impact the
1755
+ return value when used in ``st.data_editor``.
1740
1756
 
1741
1757
  min_value: datetime.time or None
1742
1758
  The minimum time that can be entered. If this is ``None`` (default),
@@ -1876,17 +1892,24 @@ def DateColumn(
1876
1892
  the user. This defaults to ``None``.
1877
1893
 
1878
1894
  format: str, "localized", "distance", "iso8601", or None
1879
- A format string controlling how the dates are displayed.
1880
- Can be one of the following:
1881
- - ``"localized"``: Shows the date in the default locale format.
1882
- - ``"distance"``: Shows the date in a relative format (e.g. "1 day ago").
1883
- - ``"iso8601"``: Shows the date in ISO 8601 format.
1884
- - A momentJS format string: See `momentJS docs <https://momentjs.com/docs/#/displaying/format/>`_
1885
- for available formats.
1886
- - ``None`` (default): uses ``YYYY-MM-DD`` as format.
1887
-
1888
- Date formatting from ``column_config`` always takes precedence over
1889
- date formatting from ``pandas.Styler``.
1895
+ A format string controlling how dates are displayed.
1896
+ This can be one of the following values:
1897
+
1898
+ - ``None`` (default): Show the date in ``"YYYY-MM-DD"`` format (e.g.
1899
+ "2025-03-04").
1900
+ - ``"localized"``: Show the date in the default locale format (e.g.
1901
+ "Mar 4, 2025" in the America/Los_Angeles timezone).
1902
+ - ``"distance"``: Show the date in a relative format (e.g.
1903
+ "a few seconds ago").
1904
+ - ``"iso8601"``: Show the date in ISO 8601 format (e.g.
1905
+ "2025-03-04").
1906
+ - A momentJS format string: Format the date with a string, like
1907
+ ``"ddd, MMM Do"`` to show "Tue, Mar 4th". For available formats, see
1908
+ `momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
1909
+
1910
+ Formatting from ``column_config`` always takes precedence over
1911
+ formatting from ``pandas.Styler``. The formatting does not impact the
1912
+ return value when used in ``st.data_editor``.
1890
1913
 
1891
1914
  min_value: datetime.date or None
1892
1915
  The minimum date that can be entered. If this is ``None`` (default),
@@ -1996,25 +2019,29 @@ def ProgressColumn(
1996
2019
  ``st.markdown``.
1997
2020
 
1998
2021
  format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
1999
- A format string controlling how numbers are displayed.
2000
- Can be one of the following:
2001
-
2002
- - ``"plain"``: Shows the full number without any formatting (1234.567)
2003
- - ``"localized"``: Shows the number in the default locale format (1,234.567)
2004
- - ``"percent"``: Shows the number as a percentage (123456.70%)
2005
- - ``"dollar"``: Shows the number as a dollar amount ($1,234.57)
2006
- - ``"euro"``: Shows the number as a euro amount (1,234.57)
2007
- - ``"accounting"``: Shows the number in an accounting format (1,234.00)
2008
- - ``"compact"``: Shows the number in a compact format (1.2K)
2009
- - ``"scientific"``: Shows the number in a scientific notation (1.235E3)
2010
- - ``"engineering"``: Shows the number in an engineering notation (1.235E3)
2011
- - printf-style format string: The following formatters are valid:
2012
- ``%d``, ``%e``, ``%f``, ``%g``, ``%i``, ``%u``. You can also add
2013
- prefixes and suffixes, e.g. ``"$ %.2f"`` to show a dollar prefix.
2014
- - ``None`` (default): the numbers are formatted via a default formatter.
2015
-
2016
- The number formatting does not impact the return value when used in
2017
- ``st.data_editor``.
2022
+ A format string controlling how the numbers are displayed.
2023
+ This can be one of the following values:
2024
+
2025
+ - ``None`` (default): Streamlit infers the formatting from the data.
2026
+ - ``"plain"``: Show the full number without any formatting (e.g. "1234.567").
2027
+ - ``"localized"``: Show the number in the default locale format (e.g. "1,234.567").
2028
+ - ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
2029
+ - ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
2030
+ - ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
2031
+ - ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
2032
+ - ``"compact"``: Show the number in a compact format (e.g. "1.2K").
2033
+ - ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
2034
+ - ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
2035
+ - printf-style format string: Format the number with a printf
2036
+ specifier, like ``"%d"`` to show a signed integer (e.g. "1234") or
2037
+ ``"%X"`` to show an unsigned hexidecimal integer (e.g. "4D2"). You
2038
+ can also add prefixes and suffixes. To show British pounds, use
2039
+ ``"£ %.2f"`` (e.g. 1234.57"). For more information, see `sprint-js
2040
+ <https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
2041
+
2042
+ Number formatting from ``column_config`` always takes precedence over
2043
+ number formatting from ``pandas.Styler``. The number formatting does
2044
+ not impact the return value when used in ``st.data_editor``.
2018
2045
 
2019
2046
  pinned: bool or None
2020
2047
  Whether the column is pinned. A pinned column will stay visible on the
@@ -2085,8 +2112,8 @@ def JsonColumn(
2085
2112
  ) -> ColumnConfig:
2086
2113
  """Configure a JSON column in ``st.dataframe`` or ``st.data_editor``.
2087
2114
 
2088
- Cells need to contain a JSON string or JSON-compatible objects.
2089
- JSON columns are not editable at the moment. This command needs to be used in the
2115
+ Cells need to contain JSON strings or JSON-compatible objects. JSON columns
2116
+ are not editable at the moment. This command needs to be used in the
2090
2117
  ``column_config`` parameter of ``st.dataframe`` or ``st.data_editor``.
2091
2118
 
2092
2119
  Parameters
@@ -2106,8 +2133,12 @@ def JsonColumn(
2106
2133
  - ``"large"``: 400px wide
2107
2134
 
2108
2135
  help: str or None
2109
- An optional tooltip that gets displayed when hovering over the column
2110
- label. If this is ``None`` (default), no tooltip is displayed.
2136
+ A tooltip that gets displayed when hovering over the column label. If
2137
+ this is ``None`` (default), no tooltip is displayed.
2138
+
2139
+ The tooltip can optionally contain GitHub-flavored Markdown, including
2140
+ the Markdown directives described in the ``body`` parameter of
2141
+ ``st.markdown``.
2111
2142
 
2112
2143
  pinned: bool or None
2113
2144
  Whether the column is pinned. A pinned column will stay visible on the
@@ -335,8 +335,19 @@ class ButtonMixin:
335
335
  including the Markdown directives described in the ``body``
336
336
  parameter of ``st.markdown``.
337
337
 
338
- on_click : callable
339
- An optional callback invoked when this button is clicked.
338
+ on_click : callable, "rerun", "ignore", or None
339
+ How the button should respond to user interaction. This controls
340
+ whether or not the button triggers a rerun and if a callback
341
+ function is called. This can be one of the following values:
342
+
343
+ - ``"rerun"`` (default): The user downloads the file and the app
344
+ reruns. No callback function is called.
345
+ - ``"ignore"``: The user downloads the file and the app doesn't
346
+ rerun. No callback function is called.
347
+ - A ``callable``: The user downloads the file and app reruns. The
348
+ callable is called before the rest of the app.
349
+ - ``None``: This is same as ``on_click="rerun"``. This value exists
350
+ for backwards compatibility and shouldn't be used.
340
351
 
341
352
  args : tuple
342
353
  An optional tuple of args to pass to the callback.
@@ -636,10 +636,10 @@ class DataEditorMixin:
636
636
 
637
637
  use_container_width : bool
638
638
  Whether to override ``width`` with the width of the parent
639
- container. If ``use_container_width`` is ``False``, Streamlit
640
- sets the data editor's width according to ``width``. If
641
- ``use_container_width`` is ``True`` (default), Streamlit sets the
642
- width of the data editor to match the width of the parent container.
639
+ container. If this is ``True`` (default), Streamlit sets the width
640
+ of the data editor to match the width of the parent container. If
641
+ this is ``False``, Streamlit sets the data editor's width according
642
+ to ``width``.
643
643
 
644
644
  hide_index : bool or None
645
645
  Whether to hide the index column(s). If ``hide_index`` is ``None``
@@ -697,7 +697,8 @@ class DataEditorMixin:
697
697
 
698
698
  row_height : int or None
699
699
  The height of each row in the data editor in pixels. If ``row_height``
700
- is ``None`` (default), Streamlit will use a default row height.
700
+ is ``None`` (default), Streamlit will use a default row height,
701
+ which fits one line of text.
701
702
 
702
703
  Returns
703
704
  -------
@@ -240,8 +240,9 @@ class NumberInputMixin:
240
240
  format : str or None
241
241
  A printf-style format string controlling how the interface should
242
242
  display numbers. The output must be purely numeric. This does not
243
- impact the return value of the widget. Formatting is handled by
244
- `sprintf.js <https://github.com/alexei/sprintf.js>`_.
243
+ impact the return value of the widget. For more information about
244
+ the formatting specification, see `sprintf.js
245
+ <https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
245
246
 
246
247
  For example, ``format="%0.1f"`` adjusts the displayed decimal
247
248
  precision to only show one digit after the decimal.
@@ -415,9 +415,17 @@ class SliderMixin:
415
415
  format : str or None
416
416
  A printf-style format string controlling how the interface should
417
417
  display numbers. This does not impact the return value.
418
- Formatter for int/float supports: %d %e %f %g %i
419
- Formatter for date/time/datetime uses Moment.js notation:
420
- https://momentjs.com/docs/#/displaying/format/
418
+
419
+ For information about formatting integers and floats, see
420
+ `sprintf.js
421
+ <https://github.com/alexei/sprintf.js?tab=readme-ov-file#format-specification>`_.
422
+ For example, ``format="%0.1f"`` adjusts the displayed decimal
423
+ precision to only show one digit after the decimal.
424
+
425
+ For information about formatting datetimes, dates, and times, see
426
+ `momentJS <https://momentjs.com/docs/#/displaying/format/>`_.
427
+ For example, ``format="ddd ha"`` adjusts the displayed datetime to
428
+ show the day of the week and the hour ("Tue 8pm").
421
429
 
422
430
  key : str or int
423
431
  An optional string or integer to use as the unique key for the widget.
@@ -146,6 +146,8 @@ class ContextProxy:
146
146
 
147
147
  Examples
148
148
  --------
149
+ **Example 1: Access all available headers**
150
+
149
151
  Show a dictionary of headers (with only the last instance of any
150
152
  repeated key):
151
153
 
@@ -153,6 +155,8 @@ class ContextProxy:
153
155
  >>>
154
156
  >>> st.context.headers
155
157
 
158
+ **Example 2: Access a specific header**
159
+
156
160
  Show the value of a specific header (or the last instance if it's
157
161
  repeated):
158
162
 
@@ -183,12 +187,16 @@ class ContextProxy:
183
187
 
184
188
  Examples
185
189
  --------
190
+ **Example 1: Access all available cookies**
191
+
186
192
  Show a dictionary of cookies:
187
193
 
188
194
  >>> import streamlit as st
189
195
  >>>
190
196
  >>> st.context.cookies
191
197
 
198
+ **Example 2: Access a specific cookie**
199
+
192
200
  Show the value of a specific cookie:
193
201
 
194
202
  >>> import streamlit as st
@@ -209,7 +217,26 @@ class ContextProxy:
209
217
  @property
210
218
  @gather_metrics("context.timezone")
211
219
  def timezone(self) -> str | None:
212
- """The timezone of the user's browser, read-only."""
220
+ """The read-only timezone of the user's browser.
221
+
222
+ Example
223
+ -------
224
+ Access the user's timezone, and format a datetime to display locally:
225
+
226
+ >>> import streamlit as st
227
+ >>> from datetime import datetime, timezone
228
+ >>> import pytz
229
+ >>>
230
+ >>> tz = st.context.timezone
231
+ >>> tz_obj = pytz.timezone(tz)
232
+ >>>
233
+ >>> now = datetime.now(timezone.utc)
234
+ >>>
235
+ >>> f"The user's timezone is {tz}."
236
+ >>> f"The UTC time is {now}."
237
+ >>> f"The user's local time is {now.astimezone(tz_obj)}"
238
+
239
+ """
213
240
  ctx = get_script_run_ctx()
214
241
 
215
242
  if ctx is None or ctx.context_info is None:
@@ -219,7 +246,25 @@ class ContextProxy:
219
246
  @property
220
247
  @gather_metrics("context.timezone_offset")
221
248
  def timezone_offset(self) -> int | None:
222
- """The timezone offset of the user's browser, read-only."""
249
+ """The read-only timezone offset of the user's browser.
250
+
251
+ Example
252
+ -------
253
+ Access the user's timezone offset, and format a datetime to display locally:
254
+
255
+ >>> import streamlit as st
256
+ >>> from datetime import datetime, timezone, timedelta
257
+ >>>
258
+ >>> tzoff = st.context.timezone_offset
259
+ >>> tz_obj = timezone(-timedelta(minutes=tzoff))
260
+ >>>
261
+ >>> now = datetime.now(timezone.utc)
262
+ >>>
263
+ >>> f"The user's timezone is {tz}."
264
+ >>> f"The UTC time is {now}."
265
+ >>> f"The user's local time is {now.astimezone(tz_obj)}"
266
+
267
+ """
223
268
  ctx = get_script_run_ctx()
224
269
  if ctx is None or ctx.context_info is None:
225
270
  return None
@@ -51,7 +51,7 @@
51
51
  <script>
52
52
  window.prerenderReady = false
53
53
  </script>
54
- <script type="module" crossorigin src="./static/js/index.DfNAkKAr.js"></script>
54
+ <script type="module" crossorigin src="./static/js/index.CqU47T61.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="./static/css/index.DpJG_94W.css">
56
56
  </head>
57
57
  <body>
@@ -1 +1 @@
1
- import{r as e,E as n,_ as a}from"./index.DfNAkKAr.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
1
+ import{r as e,E as n,_ as a}from"./index.CqU47T61.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};