streamlit-nightly 1.43.3.dev20250323__py3-none-any.whl → 1.44.1.dev20250325__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.
- streamlit/config.py +69 -24
- streamlit/elements/exception.py +8 -0
- streamlit/elements/markdown.py +35 -21
- streamlit/elements/widgets/number_input.py +41 -11
- streamlit/elements/widgets/slider.py +17 -5
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/NumberInput_pb2.py +4 -4
- streamlit/proto/NumberInput_pb2.pyi +4 -1
- streamlit/runtime/context.py +21 -1
- streamlit/static/index.html +2 -2
- streamlit/static/static/css/{index.BOl9eq08.css → index.DKr_zoDj.css} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BQODA0kT.js → FileDownload.esm.B-UWWWdT.js} +1 -1
- streamlit/static/static/js/{FileHelper.Cd1NC1sj.js → FileHelper.DRtEaIrj.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.t3Y3brxz.js → FormClearHelper.B_xJLRtH.js} +1 -1
- streamlit/static/static/js/{Hooks.CVhAgsX9.js → Hooks.DtzWH7N2.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CY0iaCAH.js → InputInstructions.CkYMcz8B.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BsUYMROy.js → ProgressBar.Drx8XNKv.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DY-eA855.js → RenderInPortalIfExists.BSkIOPqr.js} +1 -1
- streamlit/static/static/js/{Toolbar.B4w5KGXT.js → Toolbar.2r5jAJur.js} +1 -1
- streamlit/static/static/js/{base-input.DBVZTUu3.js → base-input.CV_PJtfn.js} +1 -1
- streamlit/static/static/js/{checkbox.JQMF-1O8.js → checkbox.CZjCrRM6.js} +1 -1
- streamlit/static/static/js/{createSuper.D9POSiaD.js → createSuper.wNbYZKaS.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DtRjA_2u.js → data-grid-overlay-editor.CxDiXQOm.js} +1 -1
- streamlit/static/static/js/{downloader.DoWSr1Wv.js → downloader.BKhc9vo-.js} +1 -1
- streamlit/static/static/js/{es6.1WEohfAS.js → es6.DMMA5jEp.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.Cvg5l91o.js → iframeResizer.contentWindow.rU5g5dG9.js} +1 -1
- streamlit/static/static/js/{index.tob7mjfs.js → index.60o7QeO8.js} +106 -106
- streamlit/static/static/js/index.6LeN9cCn.js +1 -0
- streamlit/static/static/js/{index.DxnPo6ts.js → index.B5181i5i.js} +1 -1
- streamlit/static/static/js/{index.CWCekiqc.js → index.B5pjbkNu.js} +1 -1
- streamlit/static/static/js/{index.CVHkuXW-.js → index.BDnhO8N2.js} +1 -1
- streamlit/static/static/js/index.BGHyjPoE.js +1 -0
- streamlit/static/static/js/index.BKHYl8ma.js +1 -0
- streamlit/static/static/js/{index.KS80Jqcr.js → index.BW1ps7Ve.js} +1 -1
- streamlit/static/static/js/{index.TIhv6y57.js → index.B_lGEToe.js} +2 -2
- streamlit/static/static/js/{index.u6AcjnZ7.js → index.BnFXM4vg.js} +1 -1
- streamlit/static/static/js/{index.yDsW8OSl.js → index.BvR3oAAg.js} +1 -1
- streamlit/static/static/js/{index.CbsyIVuK.js → index.BxcYwJga.js} +1 -1
- streamlit/static/static/js/{index.QthdDCoR.js → index.C5tuUwoV.js} +1 -1
- streamlit/static/static/js/{index.ZPl-HR8t.js → index.C5x1XZ52.js} +1 -1
- streamlit/static/static/js/{index.CqFs_RV7.js → index.C7Pn7DNY.js} +1 -1
- streamlit/static/static/js/{index.C6kAgSN4.js → index.C8fLs5OO.js} +1 -1
- streamlit/static/static/js/{index.BGnNI-8W.js → index.CEK_kfj1.js} +1 -1
- streamlit/static/static/js/{index.BLrbLqQH.js → index.CLpTIY8k.js} +1 -1
- streamlit/static/static/js/{index.CM19fnJb.js → index.COu5ow_u.js} +1 -1
- streamlit/static/static/js/{index.TDz7M2Mf.js → index.CY2a3G5f.js} +1 -1
- streamlit/static/static/js/index.CcHn1Jbf.js +1 -0
- streamlit/static/static/js/{index.C2tYobH0.js → index.CdUwInkp.js} +1 -1
- streamlit/static/static/js/{index.CSu8uGcy.js → index.Ci8MtnNW.js} +9 -9
- streamlit/static/static/js/{index.Dm7Igyrl.js → index.Cj6d-zQP.js} +1 -1
- streamlit/static/static/js/{index.DBtMVdzG.js → index.CjiDtsfR.js} +1 -1
- streamlit/static/static/js/{index.C7mtJOo5.js → index.DMOnosvH.js} +1 -1
- streamlit/static/static/js/{index.DelVBbuJ.js → index.Dh-GaoLL.js} +1 -1
- streamlit/static/static/js/{index.GXpLCsb-.js → index.DkHRVwYA.js} +8 -8
- streamlit/static/static/js/{index.D4xt261U.js → index.DmhhLL_7.js} +1 -1
- streamlit/static/static/js/index.PUoEdeCj.js +1 -0
- streamlit/static/static/js/{index.DCnMWZnR.js → index.YSxp_z0H.js} +1 -1
- streamlit/static/static/js/{index.BZkaPg7D.js → index.aJaKE3aW.js} +1 -1
- streamlit/static/static/js/{index.XgC4xRfH.js → index.hYp-Io20.js} +1 -1
- streamlit/static/static/js/{index.Du3BwWO7.js → index.lLHaP-WG.js} +1 -1
- streamlit/static/static/js/{index.CTYaWMIL.js → index.poiWcDhd.js} +1 -1
- streamlit/static/static/js/{index.B3VEOweF.js → index.qaTnk5v5.js} +7 -7
- streamlit/static/static/js/{index.CXWWimKv.js → index.wpF1efVn.js} +1 -1
- streamlit/static/static/js/{input.CO7BKD8r.js → input.hfihv8cy.js} +1 -1
- streamlit/static/static/js/{memory.BemPMzyI.js → memory.CwFUs_rm.js} +1 -1
- streamlit/static/static/js/{mergeWith.DP8mfmL6.js → mergeWith.NipycHTn.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.ginZOZcu.js → number-overlay-editor.BOZydn7S.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DBNJUrmv.js → possibleConstructorReturn.BegGyJAz.js} +1 -1
- streamlit/static/static/js/{sandbox.jDcIxry_.js → sandbox.UTLHU4Ul.js} +1 -1
- streamlit/static/static/js/{textarea.BtBLwbqz.js → textarea.dlySzlub.js} +1 -1
- streamlit/static/static/js/{timepicker.qTjYkAuk.js → timepicker.QFZeHTS5.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CAEOgwcy.js → toConsumableArray.D1_QwNnQ.js} +1 -1
- streamlit/static/static/js/{uniqueId.BR7o9Ap9.js → uniqueId.DrcTmetR.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Dl0fFJUN.js → useBasicWidgetState.jMbeuIfG.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.B20T1pKy.js → useOnInputChange.CsqSzHwu.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DI_yRwBc.js → withFullScreenWrapper.Cnlc3o1n.js} +1 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.C21bROXx.woff2 +0 -0
- streamlit/watcher/util.py +6 -6
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/RECORD +84 -84
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/index.BEsq7fPh.js +0 -1
- streamlit/static/static/js/index.Cgs75YoN.js +0 -1
- streamlit/static/static/js/index.Czpau2RI.js +0 -1
- streamlit/static/static/js/index.Dln3BV86.js +0 -1
- streamlit/static/static/js/index.aC7qpPWU.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
- {streamlit_nightly-1.43.3.dev20250323.data → streamlit_nightly-1.44.1.dev20250325.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.43.3.dev20250323.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/top_level.txt +0 -0
streamlit/config.py
CHANGED
@@ -1052,53 +1052,72 @@ _create_theme_options(
|
|
1052
1052
|
categories=["theme"],
|
1053
1053
|
description="""
|
1054
1054
|
The preset Streamlit theme that your custom theme inherits from.
|
1055
|
-
|
1055
|
+
This can be one of the following: "light" or "dark".
|
1056
1056
|
""",
|
1057
1057
|
)
|
1058
1058
|
|
1059
1059
|
_create_theme_options(
|
1060
1060
|
"primaryColor",
|
1061
1061
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1062
|
-
description="
|
1062
|
+
description="""
|
1063
|
+
Primary accent color.
|
1064
|
+
""",
|
1063
1065
|
)
|
1064
1066
|
|
1065
1067
|
_create_theme_options(
|
1066
1068
|
"backgroundColor",
|
1067
1069
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1068
|
-
description="
|
1070
|
+
description="""
|
1071
|
+
Background color of the app.
|
1072
|
+
""",
|
1069
1073
|
)
|
1070
1074
|
|
1071
1075
|
_create_theme_options(
|
1072
1076
|
"secondaryBackgroundColor",
|
1073
1077
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1074
|
-
description="
|
1078
|
+
description="""
|
1079
|
+
Background color used for most interactive widgets.
|
1080
|
+
""",
|
1075
1081
|
)
|
1076
1082
|
|
1077
1083
|
_create_theme_options(
|
1078
1084
|
"textColor",
|
1079
1085
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1080
|
-
description="
|
1086
|
+
description="""
|
1087
|
+
Color used for almost all text.
|
1088
|
+
""",
|
1081
1089
|
)
|
1082
1090
|
|
1083
1091
|
_create_theme_options(
|
1084
1092
|
"linkColor",
|
1085
1093
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1086
|
-
description="
|
1094
|
+
description="""
|
1095
|
+
Color used for all links.
|
1096
|
+
""",
|
1087
1097
|
)
|
1088
1098
|
|
1089
1099
|
_create_theme_options(
|
1090
1100
|
"codeBackgroundColor",
|
1091
1101
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1092
|
-
description="
|
1102
|
+
description="""
|
1103
|
+
Background color used for code blocks.
|
1104
|
+
""",
|
1093
1105
|
)
|
1094
1106
|
|
1095
1107
|
_create_theme_options(
|
1096
1108
|
"font",
|
1097
1109
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1098
1110
|
description="""
|
1099
|
-
The font family for all text
|
1100
|
-
|
1101
|
-
|
1111
|
+
The font family for all text, except code blocks. This can be one of
|
1112
|
+
the following:
|
1113
|
+
- "sans-serif"
|
1114
|
+
- "serif"
|
1115
|
+
- "monospace"
|
1116
|
+
- the `font` value for a custom font table under [[theme.fontFaces]]
|
1117
|
+
- a comma-separated list of these (as a single string) to specify
|
1118
|
+
fallbacks
|
1119
|
+
For example, you can use the following:
|
1120
|
+
font = "cool-font, fallback-cool-font, sans-serif"
|
1102
1121
|
""",
|
1103
1122
|
)
|
1104
1123
|
|
@@ -1106,8 +1125,14 @@ _create_theme_options(
|
|
1106
1125
|
"codeFont",
|
1107
1126
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1108
1127
|
description="""
|
1109
|
-
The font family to use for code (monospace) in the
|
1110
|
-
|
1128
|
+
The font family to use for code (monospace) in the sidebar. This can be
|
1129
|
+
one of the following:
|
1130
|
+
- "sans-serif"
|
1131
|
+
- "serif"
|
1132
|
+
- "monospace"
|
1133
|
+
- the `font` value for a custom font table under [[theme.fontFaces]]
|
1134
|
+
- a comma-separated list of these (as a single string) to specify
|
1135
|
+
fallbacks
|
1111
1136
|
""",
|
1112
1137
|
)
|
1113
1138
|
|
@@ -1115,8 +1140,14 @@ _create_theme_options(
|
|
1115
1140
|
"headingFont",
|
1116
1141
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1117
1142
|
description="""
|
1118
|
-
The font family to use for headings
|
1119
|
-
|
1143
|
+
The font family to use for headings. This can be one of the following:
|
1144
|
+
- "sans-serif"
|
1145
|
+
- "serif"
|
1146
|
+
- "monospace"
|
1147
|
+
- the `font` value for a custom font table under [[theme.fontFaces]]
|
1148
|
+
- a comma-separated list of these (as a single string) to specify
|
1149
|
+
fallbacks
|
1150
|
+
If no heading font is set, Streamlit uses `theme.font` for headings.
|
1120
1151
|
""",
|
1121
1152
|
)
|
1122
1153
|
|
@@ -1124,17 +1155,31 @@ _create_theme_options(
|
|
1124
1155
|
"fontFaces",
|
1125
1156
|
categories=["theme"],
|
1126
1157
|
description="""
|
1127
|
-
|
1128
|
-
|
1158
|
+
An array of fonts to use in your app. Each font in the array is a table
|
1159
|
+
(dictionary) with the following three attributes: font, url, weight,
|
1160
|
+
and style. To host a font with your app, enable static file serving
|
1161
|
+
with `server.enableStaticServing=true`. You can define multiple
|
1162
|
+
[[theme.fontFaces]] tables.
|
1163
|
+
|
1164
|
+
For example, each font is defined in a [[theme.fontFaces]] table as
|
1165
|
+
follows:
|
1166
|
+
[[theme.fontFaces]]
|
1167
|
+
font = "font_name"
|
1168
|
+
url = "app/static/font_file.woff"
|
1169
|
+
weight = 400
|
1170
|
+
style = "normal"
|
1171
|
+
""",
|
1129
1172
|
)
|
1130
1173
|
|
1131
1174
|
_create_theme_options(
|
1132
1175
|
"baseRadius",
|
1133
1176
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1134
1177
|
description="""
|
1135
|
-
The radius used as basis for the corners of most UI elements.
|
1136
|
-
"none", "small", "medium", "large", "full",
|
1137
|
-
|
1178
|
+
The radius used as basis for the corners of most UI elements. This can
|
1179
|
+
be one of the following: "none", "small", "medium", "large", "full",
|
1180
|
+
or the number in pixels or rem. For example, you can use "10px",
|
1181
|
+
"0.5rem", or "2rem". To follow best practices, use rem instead of
|
1182
|
+
pixels when specifying a numeric size.
|
1138
1183
|
""",
|
1139
1184
|
)
|
1140
1185
|
|
@@ -1150,8 +1195,7 @@ _create_theme_options(
|
|
1150
1195
|
"showWidgetBorder",
|
1151
1196
|
categories=["theme", CustomThemeCategories.SIDEBAR],
|
1152
1197
|
description="""
|
1153
|
-
Whether to show a border around input widgets
|
1154
|
-
file_uploader, etc).
|
1198
|
+
Whether to show a border around input widgets.
|
1155
1199
|
""",
|
1156
1200
|
type_=bool,
|
1157
1201
|
)
|
@@ -1160,8 +1204,8 @@ _create_theme_options(
|
|
1160
1204
|
"baseFontSize",
|
1161
1205
|
categories=["theme"],
|
1162
1206
|
description="""
|
1163
|
-
Sets the root font size (in pixels) for the app, which determines the
|
1164
|
-
scale of text and UI elements. The default base font size is 16.
|
1207
|
+
Sets the root font size (in pixels) for the app, which determines the
|
1208
|
+
overall scale of text and UI elements. The default base font size is 16.
|
1165
1209
|
""",
|
1166
1210
|
type_=int,
|
1167
1211
|
)
|
@@ -1170,7 +1214,8 @@ _create_theme_options(
|
|
1170
1214
|
"showSidebarBorder",
|
1171
1215
|
categories=["theme"],
|
1172
1216
|
description="""
|
1173
|
-
Whether to show a vertical separator between the sidebar and the main
|
1217
|
+
Whether to show a vertical separator between the sidebar and the main
|
1218
|
+
content area.
|
1174
1219
|
""",
|
1175
1220
|
type_=bool,
|
1176
1221
|
)
|
streamlit/elements/exception.py
CHANGED
@@ -43,6 +43,10 @@ class ExceptionMixin:
|
|
43
43
|
def exception(self, exception: BaseException) -> DeltaGenerator:
|
44
44
|
"""Display an exception.
|
45
45
|
|
46
|
+
In the lower-right corner of the exception, Streamlit displays links to
|
47
|
+
Google and ChatGPT that are prefilled with the contents of the
|
48
|
+
exception message.
|
49
|
+
|
46
50
|
Parameters
|
47
51
|
----------
|
48
52
|
exception : Exception
|
@@ -55,6 +59,10 @@ class ExceptionMixin:
|
|
55
59
|
>>> e = RuntimeError("This is an exception of type RuntimeError")
|
56
60
|
>>> st.exception(e)
|
57
61
|
|
62
|
+
.. output ::
|
63
|
+
https://doc-status-exception.streamlit.app/
|
64
|
+
height: 220px
|
65
|
+
|
58
66
|
"""
|
59
67
|
return _exception(self.dg, exception)
|
60
68
|
|
streamlit/elements/markdown.py
CHANGED
@@ -81,9 +81,10 @@ class MarkdownMixin:
|
|
81
81
|
configuration option.
|
82
82
|
|
83
83
|
- Colored badges, using the syntax ``:color-badge[text in the badge]``.
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
``color`` must be replaced with any of the following supported
|
85
|
+
colors: blue, green, orange, red, violet, gray/grey, or primary.
|
86
|
+
For example, you can use ``:orange-badge[your text here]`` or
|
87
|
+
``:blue-badge[your text here]``.
|
87
88
|
|
88
89
|
- Small text, using the syntax ``:small[text to show small]``.
|
89
90
|
|
@@ -291,16 +292,21 @@ class MarkdownMixin:
|
|
291
292
|
"violet",
|
292
293
|
"gray",
|
293
294
|
"grey",
|
294
|
-
"rainbow",
|
295
295
|
"primary",
|
296
296
|
] = "blue",
|
297
297
|
) -> DeltaGenerator:
|
298
298
|
"""Display a colored badge with an icon and label.
|
299
299
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
300
|
+
This is a thin wrapper around the color-badge Markdown directive.
|
301
|
+
The following are equivalent:
|
302
|
+
|
303
|
+
- ``st.markdown(":blue-badge[Home]")``
|
304
|
+
- ``st.badge("Home", color="blue")``
|
305
|
+
|
306
|
+
.. note::
|
307
|
+
You can insert badges everywhere Streamlit supports Markdown by
|
308
|
+
using the color-badge Markdown directive. See ``st.markdown`` for
|
309
|
+
more information.
|
304
310
|
|
305
311
|
Parameters
|
306
312
|
----------
|
@@ -310,7 +316,9 @@ class MarkdownMixin:
|
|
310
316
|
Strikethroughs, Inline Code.
|
311
317
|
|
312
318
|
See the ``body`` parameter of |st.markdown|_ for additional,
|
313
|
-
supported Markdown directives.
|
319
|
+
supported Markdown directives. Because this command escapes square
|
320
|
+
brackets (``[ ]``) in this parameter, any directive requiring
|
321
|
+
square brackets is not supported.
|
314
322
|
|
315
323
|
.. |st.markdown| replace:: ``st.markdown``
|
316
324
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
@@ -333,26 +341,32 @@ class MarkdownMixin:
|
|
333
341
|
font library.
|
334
342
|
|
335
343
|
color : str
|
336
|
-
The color to use for the badge.
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
344
|
+
The color to use for the badge. This defaults to ``"blue"``.
|
345
|
+
|
346
|
+
This can be one of the following supported colors: blue, green,
|
347
|
+
orange, red, violet, gray/grey, or primary. If you use
|
348
|
+
``"primary"``, Streamlit will use the default primary accent color
|
349
|
+
unless you set the ``theme.primaryColor`` configuration option.
|
341
350
|
|
342
351
|
Examples
|
343
352
|
--------
|
353
|
+
Create standalone badges with ``st.badge`` (with or without icons). If
|
354
|
+
you want to have multiple, side-by-side badges, you can use the
|
355
|
+
Markdown directive in ``st.markdown``.
|
356
|
+
|
344
357
|
>>> import streamlit as st
|
345
358
|
>>>
|
346
|
-
>>>
|
347
|
-
>>> st.badge("Home")
|
348
|
-
>>>
|
349
|
-
>>> # Badge with icon and color
|
359
|
+
>>> st.badge("New")
|
350
360
|
>>> st.badge("Success", icon=":material/check:", color="green")
|
351
361
|
>>>
|
352
|
-
>>> # Multiple badges side by side in Markdown
|
353
362
|
>>> st.markdown(
|
354
|
-
|
355
|
-
|
363
|
+
>>> ":violet-badge[:material/star: Favorite] :orange-badge[⚠️ Needs review] :gray-badge[Deprecated]"
|
364
|
+
>>> )
|
365
|
+
|
366
|
+
.. output ::
|
367
|
+
https://doc-badge.streamlit.app/
|
368
|
+
height: 220px
|
369
|
+
|
356
370
|
"""
|
357
371
|
if icon is not None:
|
358
372
|
icon_str = validate_icon_or_emoji(icon) + " "
|
@@ -51,6 +51,7 @@ from streamlit.runtime.state import (
|
|
51
51
|
get_session_state,
|
52
52
|
register_widget,
|
53
53
|
)
|
54
|
+
from streamlit.string_util import validate_icon_or_emoji
|
54
55
|
|
55
56
|
if TYPE_CHECKING:
|
56
57
|
from streamlit.delta_generator import DeltaGenerator
|
@@ -97,7 +98,7 @@ class NumberInputMixin:
|
|
97
98
|
max_value: int | None = None,
|
98
99
|
value: IntOrNone | Literal["min"] = "min",
|
99
100
|
step: int | None = None,
|
100
|
-
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, *, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible"
|
101
|
+
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, *, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible", icon: str | None = None
|
101
102
|
) -> int | IntOrNone:
|
102
103
|
...
|
103
104
|
|
@@ -114,7 +115,7 @@ class NumberInputMixin:
|
|
114
115
|
max_value: int,
|
115
116
|
value: IntOrNone | Literal["min"] = "min",
|
116
117
|
step: int | None = None,
|
117
|
-
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible"
|
118
|
+
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible", icon: str | None = None
|
118
119
|
) -> int | IntOrNone:
|
119
120
|
...
|
120
121
|
|
@@ -129,7 +130,7 @@ class NumberInputMixin:
|
|
129
130
|
*,
|
130
131
|
value: int,
|
131
132
|
step: int | None = None,
|
132
|
-
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible"
|
133
|
+
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible", icon: str | None = None
|
133
134
|
) -> int:
|
134
135
|
...
|
135
136
|
|
@@ -146,7 +147,7 @@ class NumberInputMixin:
|
|
146
147
|
value: IntOrNone | Literal["min"] = "min",
|
147
148
|
*,
|
148
149
|
step: int,
|
149
|
-
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible"
|
150
|
+
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible", icon: str | None = None
|
150
151
|
) -> int | IntOrNone:
|
151
152
|
...
|
152
153
|
|
@@ -162,7 +163,7 @@ class NumberInputMixin:
|
|
162
163
|
max_value: float | None = None,
|
163
164
|
value: FloatOrNone | Literal["min"] = "min",
|
164
165
|
step: float | None = None,
|
165
|
-
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, *, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible"
|
166
|
+
format: str | None = None, key: Key | None = None, help: str | None = None, on_change: WidgetCallback | None = None, args: WidgetArgs | None = None, kwargs: WidgetKwargs | None = None, *, placeholder: str | None = None, disabled: bool = False, label_visibility: LabelVisibility = "visible", icon: str | None = None
|
166
167
|
) -> float | FloatOrNone:
|
167
168
|
...
|
168
169
|
# # fmt: on
|
@@ -185,6 +186,7 @@ class NumberInputMixin:
|
|
185
186
|
placeholder: str | None = None,
|
186
187
|
disabled: bool = False,
|
187
188
|
label_visibility: LabelVisibility = "visible",
|
189
|
+
icon: str | None = None,
|
188
190
|
) -> Number | None:
|
189
191
|
r"""Display a numeric input widget.
|
190
192
|
|
@@ -220,17 +222,22 @@ class NumberInputMixin:
|
|
220
222
|
|
221
223
|
min_value : int, float, or None
|
222
224
|
The minimum permitted value.
|
223
|
-
If None, there will be no minimum
|
225
|
+
If this is ``None`` (default), there will be no minimum for float
|
226
|
+
values and a minimum of ``- (1<<53) + 1`` for integer values.
|
224
227
|
|
225
228
|
max_value : int, float, or None
|
226
229
|
The maximum permitted value.
|
227
|
-
If None, there will be no maximum
|
230
|
+
If this is ``None`` (default), there will be no maximum for float
|
231
|
+
values and a maximum of ``(1<<53) - 1`` for integer values.
|
228
232
|
|
229
233
|
value : int, float, "min" or None
|
230
|
-
The value of this widget when it first renders. If
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
+
The value of this widget when it first renders. If this is
|
235
|
+
``"min"`` (default), the initial value is ``min_value`` unless
|
236
|
+
``min_value`` is ``None``. If ``min_value`` is ``None``, the widget
|
237
|
+
initializes with a value of ``0.0`` or ``0``.
|
238
|
+
|
239
|
+
If ``value`` is ``None``, the widget will initialize with no value
|
240
|
+
and return ``None`` until the user provides input.
|
234
241
|
|
235
242
|
step : int, float, or None
|
236
243
|
The stepping interval.
|
@@ -284,6 +291,23 @@ class NumberInputMixin:
|
|
284
291
|
label, which can help keep the widget alligned with other widgets.
|
285
292
|
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
286
293
|
|
294
|
+
icon : str, None
|
295
|
+
An optional emoji or icon to display next to the alert. If ``icon``
|
296
|
+
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
297
|
+
string, the following options are valid:
|
298
|
+
|
299
|
+
- A single-character emoji. For example, you can set ``icon="🚨"``
|
300
|
+
or ``icon="🔥"``. Emoji short codes are not supported.
|
301
|
+
|
302
|
+
- An icon from the Material Symbols library (rounded style) in the
|
303
|
+
format ``":material/icon_name:"`` where "icon_name" is the name
|
304
|
+
of the icon in snake case.
|
305
|
+
|
306
|
+
For example, ``icon=":material/thumb_up:"`` will display the
|
307
|
+
Thumb Up icon. Find additional icons in the `Material Symbols \
|
308
|
+
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
309
|
+
font library.
|
310
|
+
|
287
311
|
Returns
|
288
312
|
-------
|
289
313
|
int or float or None
|
@@ -331,6 +355,7 @@ class NumberInputMixin:
|
|
331
355
|
placeholder=placeholder,
|
332
356
|
disabled=disabled,
|
333
357
|
label_visibility=label_visibility,
|
358
|
+
icon=icon,
|
334
359
|
ctx=ctx,
|
335
360
|
)
|
336
361
|
|
@@ -351,6 +376,7 @@ class NumberInputMixin:
|
|
351
376
|
placeholder: str | None = None,
|
352
377
|
disabled: bool = False,
|
353
378
|
label_visibility: LabelVisibility = "visible",
|
379
|
+
icon: str | None = None,
|
354
380
|
ctx: ScriptRunContext | None = None,
|
355
381
|
) -> Number | None:
|
356
382
|
key = to_key(key)
|
@@ -375,6 +401,7 @@ class NumberInputMixin:
|
|
375
401
|
format=format,
|
376
402
|
help=help,
|
377
403
|
placeholder=None if placeholder is None else str(placeholder),
|
404
|
+
icon=icon,
|
378
405
|
)
|
379
406
|
|
380
407
|
# Ensure that all arguments are of the same type.
|
@@ -524,6 +551,9 @@ class NumberInputMixin:
|
|
524
551
|
if format is not None:
|
525
552
|
number_input_proto.format = format
|
526
553
|
|
554
|
+
if icon is not None:
|
555
|
+
number_input_proto.icon = validate_icon_or_emoji(icon)
|
556
|
+
|
527
557
|
serde = NumberInputSerde(value, data_type)
|
528
558
|
widget_state = register_widget(
|
529
559
|
number_input_proto.id,
|
@@ -398,20 +398,32 @@ class SliderMixin:
|
|
398
398
|
|
399
399
|
min_value : a supported type or None
|
400
400
|
The minimum permitted value.
|
401
|
-
|
402
|
-
|
401
|
+
If this is ``None`` (default), the minimum value depends on the
|
402
|
+
type as follows:
|
403
|
+
|
404
|
+
- integer: ``0``
|
405
|
+
- float: ``0.0``
|
406
|
+
- date or datetime: ``value - timedelta(days=14)``
|
407
|
+
- time: ``time.min``
|
403
408
|
|
404
409
|
max_value : a supported type or None
|
405
410
|
The maximum permitted value.
|
406
|
-
|
407
|
-
|
411
|
+
If this is ``None`` (default), the maximum value depends on the
|
412
|
+
type as follows:
|
413
|
+
|
414
|
+
- integer: ``100``
|
415
|
+
- float: ``1.0``
|
416
|
+
- date or datetime: ``value + timedelta(days=14)``
|
417
|
+
- time: ``time.max``
|
408
418
|
|
409
419
|
value : a supported type or a tuple/list of supported types or None
|
410
420
|
The value of the slider when it first renders. If a tuple/list
|
411
421
|
of two values is passed here, then a range slider with those lower
|
412
422
|
and upper bounds is rendered. For example, if set to `(1, 10)` the
|
413
423
|
slider will have a selectable range between 1 and 10.
|
414
|
-
|
424
|
+
This defaults to ``min_value``. If the type is not otherwise
|
425
|
+
specified in any of the numeric parameters, the widget will have an
|
426
|
+
integer value.
|
415
427
|
|
416
428
|
step : int, float, timedelta, or None
|
417
429
|
The stepping interval.
|