streamlit-nightly 1.39.1.dev20241031__py2.py3-none-any.whl → 1.39.1.dev20241101__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 (40) hide show
  1. streamlit/commands/logo.py +3 -3
  2. streamlit/commands/navigation.py +48 -3
  3. streamlit/commands/page_config.py +3 -3
  4. streamlit/elements/image.py +26 -441
  5. streamlit/elements/layouts.py +12 -7
  6. streamlit/elements/lib/image_utils.py +433 -0
  7. streamlit/elements/markdown.py +6 -0
  8. streamlit/elements/metric.py +8 -5
  9. streamlit/elements/progress.py +2 -1
  10. streamlit/elements/pyplot.py +3 -5
  11. streamlit/elements/text.py +1 -1
  12. streamlit/elements/widgets/audio_input.py +12 -11
  13. streamlit/elements/widgets/button.py +20 -16
  14. streamlit/elements/widgets/button_group.py +146 -121
  15. streamlit/elements/widgets/camera_input.py +13 -11
  16. streamlit/elements/widgets/chat.py +2 -2
  17. streamlit/elements/widgets/checkbox.py +30 -24
  18. streamlit/elements/widgets/color_picker.py +15 -13
  19. streamlit/elements/widgets/file_uploader.py +12 -12
  20. streamlit/elements/widgets/multiselect.py +33 -31
  21. streamlit/elements/widgets/number_input.py +15 -12
  22. streamlit/elements/widgets/radio.py +15 -12
  23. streamlit/elements/widgets/select_slider.py +15 -12
  24. streamlit/elements/widgets/selectbox.py +19 -14
  25. streamlit/elements/widgets/slider.py +15 -12
  26. streamlit/elements/widgets/text_widgets.py +33 -27
  27. streamlit/elements/widgets/time_widgets.py +33 -25
  28. streamlit/hello/{Animation_Demo.py → animation_demo.py} +9 -10
  29. streamlit/hello/{Dataframe_Demo.py → dataframe_demo.py} +9 -15
  30. streamlit/hello/{Hello.py → hello.py} +7 -12
  31. streamlit/hello/{Mapping_Demo.py → mapping_demo.py} +10 -13
  32. streamlit/hello/{Plotting_Demo.py → plotting_demo.py} +9 -10
  33. streamlit/hello/streamlit_app.py +24 -6
  34. streamlit/proto/Image_pb2.pyi +1 -1
  35. {streamlit_nightly-1.39.1.dev20241031.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/METADATA +1 -1
  36. {streamlit_nightly-1.39.1.dev20241031.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/RECORD +40 -39
  37. {streamlit_nightly-1.39.1.dev20241031.data → streamlit_nightly-1.39.1.dev20241101.data}/scripts/streamlit.cmd +0 -0
  38. {streamlit_nightly-1.39.1.dev20241031.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/WHEEL +0 -0
  39. {streamlit_nightly-1.39.1.dev20241031.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/entry_points.txt +0 -0
  40. {streamlit_nightly-1.39.1.dev20241031.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/top_level.txt +0 -0
@@ -77,8 +77,9 @@ class CheckboxMixin:
77
77
  label : str
78
78
  A short label explaining to the user what this checkbox is for.
79
79
  The label can optionally contain GitHub-flavored Markdown of the
80
- following types: Bold, Italics, Strikethroughs, Inline Code, and
81
- Links.
80
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
81
+ and Images. Images display like icons, with a max height equal to
82
+ the font height.
82
83
 
83
84
  Unsupported Markdown elements are unwrapped so only their children
84
85
  (text contents) render. Display unsupported elements as literal
@@ -88,9 +89,9 @@ class CheckboxMixin:
88
89
  See the ``body`` parameter of |st.markdown|_ for additional,
89
90
  supported Markdown directives.
90
91
 
91
- For accessibility reasons, you should never set an empty label (label="")
92
- but hide it with label_visibility if needed. In the future, we may disallow
93
- empty labels by raising an exception.
92
+ For accessibility reasons, you should never set an empty label, but
93
+ you can hide it with ``label_visibility`` if needed. In the future,
94
+ we may disallow empty labels by raising an exception.
94
95
 
95
96
  .. |st.markdown| replace:: ``st.markdown``
96
97
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -105,7 +106,9 @@ class CheckboxMixin:
105
106
  based on its content. No two widgets may have the same key.
106
107
 
107
108
  help : str
108
- An optional tooltip that gets displayed next to the checkbox.
109
+ An optional tooltip that gets displayed next to the widget label.
110
+ Streamlit only displays the tooltip when
111
+ ``label_visibility="visible"``.
109
112
 
110
113
  on_change : callable
111
114
  An optional callback invoked when this checkbox's value changes.
@@ -117,14 +120,14 @@ class CheckboxMixin:
117
120
  An optional dict of kwargs to pass to the callback.
118
121
 
119
122
  disabled : bool
120
- An optional boolean, which disables the checkbox if set to True.
121
- The default is False.
123
+ An optional boolean that disables the checkbox if set to ``True``.
124
+ The default is ``False``.
122
125
 
123
126
  label_visibility : "visible", "hidden", or "collapsed"
124
- The visibility of the label. If "hidden", the label doesn't show but there
125
- is still empty space for it (equivalent to label="").
126
- If "collapsed", both the label and the space are removed. Default is
127
- "visible".
127
+ The visibility of the label. The default is ``"visible"``. If this
128
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
129
+ label, which can help keep the widget alligned with other widgets.
130
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
128
131
 
129
132
  Returns
130
133
  -------
@@ -181,8 +184,9 @@ class CheckboxMixin:
181
184
  label : str
182
185
  A short label explaining to the user what this toggle is for.
183
186
  The label can optionally contain GitHub-flavored Markdown of the
184
- following types: Bold, Italics, Strikethroughs, Inline Code, and
185
- Links.
187
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
188
+ and Images. Images display like icons, with a max height equal to
189
+ the font height.
186
190
 
187
191
  Unsupported Markdown elements are unwrapped so only their children
188
192
  (text contents) render. Display unsupported elements as literal
@@ -192,9 +196,9 @@ class CheckboxMixin:
192
196
  See the ``body`` parameter of |st.markdown|_ for additional,
193
197
  supported Markdown directives.
194
198
 
195
- For accessibility reasons, you should never set an empty label (label="")
196
- but hide it with label_visibility if needed. In the future, we may disallow
197
- empty labels by raising an exception.
199
+ For accessibility reasons, you should never set an empty label, but
200
+ you can hide it with ``label_visibility`` if needed. In the future,
201
+ we may disallow empty labels by raising an exception.
198
202
 
199
203
  .. |st.markdown| replace:: ``st.markdown``
200
204
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -209,7 +213,9 @@ class CheckboxMixin:
209
213
  based on its content. No two widgets may have the same key.
210
214
 
211
215
  help : str
212
- An optional tooltip that gets displayed next to the toggle.
216
+ An optional tooltip that gets displayed next to the widget label.
217
+ Streamlit only displays the tooltip when
218
+ ``label_visibility="visible"``.
213
219
 
214
220
  on_change : callable
215
221
  An optional callback invoked when this toggle's value changes.
@@ -221,14 +227,14 @@ class CheckboxMixin:
221
227
  An optional dict of kwargs to pass to the callback.
222
228
 
223
229
  disabled : bool
224
- An optional boolean, which disables the toggle if set to True.
225
- The default is False.
230
+ An optional boolean that disables the toggle if set to ``True``.
231
+ The default is ``False``.
226
232
 
227
233
  label_visibility : "visible", "hidden", or "collapsed"
228
- The visibility of the label. If "hidden", the label doesn't show but there
229
- is still empty space for it (equivalent to label="").
230
- If "collapsed", both the label and the space are removed. Default is
231
- "visible".
234
+ The visibility of the label. The default is ``"visible"``. If this
235
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
236
+ label, which can help keep the widget alligned with other widgets.
237
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
232
238
 
233
239
  Returns
234
240
  -------
@@ -79,8 +79,9 @@ class ColorPickerMixin:
79
79
  label : str
80
80
  A short label explaining to the user what this input is for.
81
81
  The label can optionally contain GitHub-flavored Markdown of the
82
- following types: Bold, Italics, Strikethroughs, Inline Code, and
83
- Links.
82
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
83
+ and Images. Images display like icons, with a max height equal to
84
+ the font height.
84
85
 
85
86
  Unsupported Markdown elements are unwrapped so only their children
86
87
  (text contents) render. Display unsupported elements as literal
@@ -90,9 +91,9 @@ class ColorPickerMixin:
90
91
  See the ``body`` parameter of |st.markdown|_ for additional,
91
92
  supported Markdown directives.
92
93
 
93
- For accessibility reasons, you should never set an empty label (label="")
94
- but hide it with label_visibility if needed. In the future, we may disallow
95
- empty labels by raising an exception.
94
+ For accessibility reasons, you should never set an empty label, but
95
+ you can hide it with ``label_visibility`` if needed. In the future,
96
+ we may disallow empty labels by raising an exception.
96
97
 
97
98
  .. |st.markdown| replace:: ``st.markdown``
98
99
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -107,7 +108,9 @@ class ColorPickerMixin:
107
108
  based on its content. No two widgets may have the same key.
108
109
 
109
110
  help : str
110
- An optional tooltip that gets displayed next to the color picker.
111
+ An optional tooltip that gets displayed next to the widget label.
112
+ Streamlit only displays the tooltip when
113
+ ``label_visibility="visible"``.
111
114
 
112
115
  on_change : callable
113
116
  An optional callback invoked when this color_picker's value
@@ -120,15 +123,14 @@ class ColorPickerMixin:
120
123
  An optional dict of kwargs to pass to the callback.
121
124
 
122
125
  disabled : bool
123
- An optional boolean, which disables the color picker if set to
124
- True. The default is False. This argument can only be supplied by
125
- keyword.
126
+ An optional boolean that disables the color picker if set to
127
+ ``True``. The default is ``False``.
126
128
 
127
129
  label_visibility : "visible", "hidden", or "collapsed"
128
- The visibility of the label. If "hidden", the label doesn't show but there
129
- is still empty space for it above the widget (equivalent to label="").
130
- If "collapsed", both the label and the space are removed. Default is
131
- "visible".
130
+ The visibility of the label. The default is ``"visible"``. If this
131
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
132
+ label, which can help keep the widget alligned with other widgets.
133
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
132
134
 
133
135
  Returns
134
136
  -------
@@ -251,8 +251,9 @@ class FileUploaderMixin:
251
251
  label : str
252
252
  A short label explaining to the user what this file uploader is for.
253
253
  The label can optionally contain GitHub-flavored Markdown of the
254
- following types: Bold, Italics, Strikethroughs, Inline Code, and
255
- Links.
254
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
255
+ and Images. Images display like icons, with a max height equal to
256
+ the font height.
256
257
 
257
258
  Unsupported Markdown elements are unwrapped so only their children
258
259
  (text contents) render. Display unsupported elements as literal
@@ -262,9 +263,9 @@ class FileUploaderMixin:
262
263
  See the ``body`` parameter of |st.markdown|_ for additional,
263
264
  supported Markdown directives.
264
265
 
265
- For accessibility reasons, you should never set an empty label (label="")
266
- but hide it with label_visibility if needed. In the future, we may disallow
267
- empty labels by raising an exception.
266
+ For accessibility reasons, you should never set an empty label, but
267
+ you can hide it with ``label_visibility`` if needed. In the future,
268
+ we may disallow empty labels by raising an exception.
268
269
 
269
270
  .. |st.markdown| replace:: ``st.markdown``
270
271
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -297,15 +298,14 @@ class FileUploaderMixin:
297
298
  An optional dict of kwargs to pass to the callback.
298
299
 
299
300
  disabled : bool
300
- An optional boolean, which disables the file uploader if set to
301
- True. The default is False. This argument can only be supplied by
302
- keyword.
301
+ An optional boolean that disables the file uploader if set to
302
+ ``True``. The default is ``False``.
303
303
 
304
304
  label_visibility : "visible", "hidden", or "collapsed"
305
- The visibility of the label. If "hidden", the label doesn't show but there
306
- is still empty space for it above the widget (equivalent to label="").
307
- If "collapsed", both the label and the space are removed. Default is
308
- "visible".
305
+ The visibility of the label. The default is ``"visible"``. If this
306
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
307
+ label, which can help keep the widget alligned with other widgets.
308
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
309
309
 
310
310
  Returns
311
311
  -------
@@ -125,11 +125,12 @@ class MultiSelectMixin:
125
125
 
126
126
  Parameters
127
127
  ----------
128
- label : str
128
+ label: str
129
129
  A short label explaining to the user what this select widget is for.
130
130
  The label can optionally contain GitHub-flavored Markdown of the
131
- following types: Bold, Italics, Strikethroughs, Inline Code, and
132
- Links.
131
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
132
+ and Images. Images display like icons, with a max height equal to
133
+ the font height.
133
134
 
134
135
  Unsupported Markdown elements are unwrapped so only their children
135
136
  (text contents) render. Display unsupported elements as literal
@@ -139,14 +140,14 @@ class MultiSelectMixin:
139
140
  See the ``body`` parameter of |st.markdown|_ for additional,
140
141
  supported Markdown directives.
141
142
 
142
- For accessibility reasons, you should never set an empty label (label="")
143
- but hide it with label_visibility if needed. In the future, we may disallow
144
- empty labels by raising an exception.
143
+ For accessibility reasons, you should never set an empty label, but
144
+ you can hide it with ``label_visibility`` if needed. In the future,
145
+ we may disallow empty labels by raising an exception.
145
146
 
146
147
  .. |st.markdown| replace:: ``st.markdown``
147
148
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
148
149
 
149
- options : Iterable
150
+ options: Iterable
150
151
  Labels for the select options in an ``Iterable``. This can be a
151
152
  ``list``, ``set``, or anything supported by ``st.dataframe``. If
152
153
  ``options`` is dataframe-like, the first column will be used. Each
@@ -155,46 +156,47 @@ class MultiSelectMixin:
155
156
  default: Iterable of V, V, or None
156
157
  List of default values. Can also be a single value.
157
158
 
158
- format_func : function
159
- Function to modify the display of selectbox options. It receives
159
+ format_func: function
160
+ Function to modify the display of the options. It receives
160
161
  the raw option as an argument and should output the label to be
161
162
  shown for that option. This has no impact on the return value of
162
- the multiselect.
163
+ the command.
163
164
 
164
- key : str or int
165
+ key: str or int
165
166
  An optional string or integer to use as the unique key for the widget.
166
167
  If this is omitted, a key will be generated for the widget
167
168
  based on its content. No two widgets may have the same key.
168
169
 
169
- help : str
170
- An optional tooltip that gets displayed next to the multiselect.
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
174
 
172
- on_change : callable
173
- An optional callback invoked when this multiselect's value changes.
175
+ on_change: callable
176
+ An optional callback invoked when this widget's value changes.
174
177
 
175
- args : tuple
178
+ args: tuple
176
179
  An optional tuple of args to pass to the callback.
177
180
 
178
- kwargs : dict
181
+ kwargs: dict
179
182
  An optional dict of kwargs to pass to the callback.
180
183
 
181
- max_selections : int
184
+ max_selections: int
182
185
  The max selections that can be selected at a time.
183
186
 
184
- placeholder : str
187
+ placeholder: str
185
188
  A string to display when no options are selected.
186
- Defaults to 'Choose an option'.
187
-
188
- disabled : bool
189
- An optional boolean, which disables the multiselect widget if set
190
- to True. The default is False. This argument can only be supplied
191
- by keyword.
192
-
193
- label_visibility : "visible", "hidden", or "collapsed"
194
- The visibility of the label. If "hidden", the label doesn't show but there
195
- is still empty space for it above the widget (equivalent to label="").
196
- If "collapsed", both the label and the space are removed. Default is
197
- "visible".
189
+ Defaults to "Choose an option."
190
+
191
+ disabled: bool
192
+ An optional boolean that disables the multiselect widget if set
193
+ to ``True``. The default is ``False``.
194
+
195
+ label_visibility: "visible", "hidden", or "collapsed"
196
+ The visibility of the label. The default is ``"visible"``. If this
197
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
198
+ label, which can help keep the widget alligned with other widgets.
199
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
198
200
 
199
201
  Returns
200
202
  -------
@@ -199,8 +199,9 @@ class NumberInputMixin:
199
199
  label : str
200
200
  A short label explaining to the user what this input is for.
201
201
  The label can optionally contain GitHub-flavored Markdown of the
202
- following types: Bold, Italics, Strikethroughs, Inline Code, and
203
- Links.
202
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
203
+ and Images. Images display like icons, with a max height equal to
204
+ the font height.
204
205
 
205
206
  Unsupported Markdown elements are unwrapped so only their children
206
207
  (text contents) render. Display unsupported elements as literal
@@ -210,9 +211,9 @@ class NumberInputMixin:
210
211
  See the ``body`` parameter of |st.markdown|_ for additional,
211
212
  supported Markdown directives.
212
213
 
213
- For accessibility reasons, you should never set an empty label (label="")
214
- but hide it with label_visibility if needed. In the future, we may disallow
215
- empty labels by raising an exception.
214
+ For accessibility reasons, you should never set an empty label, but
215
+ you can hide it with ``label_visibility`` if needed. In the future,
216
+ we may disallow empty labels by raising an exception.
216
217
 
217
218
  .. |st.markdown| replace:: ``st.markdown``
218
219
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -251,7 +252,9 @@ class NumberInputMixin:
251
252
  based on its content. No two widgets may have the same key.
252
253
 
253
254
  help : str
254
- An optional tooltip that gets displayed next to the input.
255
+ An optional tooltip that gets displayed next to the widget label.
256
+ Streamlit only displays the tooltip when
257
+ ``label_visibility="visible"``.
255
258
 
256
259
  on_change : callable
257
260
  An optional callback invoked when this number_input's value changes.
@@ -267,14 +270,14 @@ class NumberInputMixin:
267
270
  If None, no placeholder is displayed.
268
271
 
269
272
  disabled : bool
270
- An optional boolean, which disables the number input if set to
271
- True. The default is False.
273
+ An optional boolean that disables the number input if set to
274
+ ``True``. The default is ``False``.
272
275
 
273
276
  label_visibility : "visible", "hidden", or "collapsed"
274
- The visibility of the label. If "hidden", the label doesn't show but there
275
- is still empty space for it above the widget (equivalent to label="").
276
- If "collapsed", both the label and the space are removed. Default is
277
- "visible".
277
+ The visibility of the label. The default is ``"visible"``. If this
278
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
279
+ label, which can help keep the widget alligned with other widgets.
280
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
278
281
 
279
282
  Returns
280
283
  -------
@@ -144,8 +144,9 @@ class RadioMixin:
144
144
  label : str
145
145
  A short label explaining to the user what this radio group is for.
146
146
  The label can optionally contain GitHub-flavored Markdown of the
147
- following types: Bold, Italics, Strikethroughs, Inline Code, and
148
- Links.
147
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
148
+ and Images. Images display like icons, with a max height equal to
149
+ the font height.
149
150
 
150
151
  Unsupported Markdown elements are unwrapped so only their children
151
152
  (text contents) render. Display unsupported elements as literal
@@ -155,9 +156,9 @@ class RadioMixin:
155
156
  See the ``body`` parameter of |st.markdown|_ for additional,
156
157
  supported Markdown directives.
157
158
 
158
- For accessibility reasons, you should never set an empty label (label="")
159
- but hide it with label_visibility if needed. In the future, we may disallow
160
- empty labels by raising an exception.
159
+ For accessibility reasons, you should never set an empty label, but
160
+ you can hide it with ``label_visibility`` if needed. In the future,
161
+ we may disallow empty labels by raising an exception.
161
162
 
162
163
  .. |st.markdown| replace:: ``st.markdown``
163
164
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -188,7 +189,9 @@ class RadioMixin:
188
189
  based on its content. No two widgets may have the same key.
189
190
 
190
191
  help : str
191
- An optional tooltip that gets displayed next to the radio.
192
+ An optional tooltip that gets displayed next to the widget label.
193
+ Streamlit only displays the tooltip when
194
+ ``label_visibility="visible"``.
192
195
 
193
196
  on_change : callable
194
197
  An optional callback invoked when this radio's value changes.
@@ -200,8 +203,8 @@ class RadioMixin:
200
203
  An optional dict of kwargs to pass to the callback.
201
204
 
202
205
  disabled : bool
203
- An optional boolean, which disables the radio button if set to
204
- True. The default is False.
206
+ An optional boolean that disables the radio button if set to
207
+ ``True``. The default is ``False``.
205
208
 
206
209
  horizontal : bool
207
210
  An optional boolean, which orients the radio group horizontally.
@@ -212,10 +215,10 @@ class RadioMixin:
212
215
  no captions are shown.
213
216
 
214
217
  label_visibility : "visible", "hidden", or "collapsed"
215
- The visibility of the label. If "hidden", the label doesn't show but there
216
- is still empty space for it above the widget (equivalent to label="").
217
- If "collapsed", both the label and the space are removed. Default is
218
- "visible".
218
+ The visibility of the label. The default is ``"visible"``. If this
219
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
220
+ label, which can help keep the widget alligned with other widgets.
221
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
219
222
 
220
223
  Returns
221
224
  -------
@@ -188,8 +188,9 @@ class SelectSliderMixin:
188
188
  label : str
189
189
  A short label explaining to the user what this slider is for.
190
190
  The label can optionally contain GitHub-flavored Markdown of the
191
- following types: Bold, Italics, Strikethroughs, Inline Code, and
192
- Links.
191
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
192
+ and Images. Images display like icons, with a max height equal to
193
+ the font height.
193
194
 
194
195
  Unsupported Markdown elements are unwrapped so only their children
195
196
  (text contents) render. Display unsupported elements as literal
@@ -199,9 +200,9 @@ class SelectSliderMixin:
199
200
  See the ``body`` parameter of |st.markdown|_ for additional,
200
201
  supported Markdown directives.
201
202
 
202
- For accessibility reasons, you should never set an empty label (label="")
203
- but hide it with label_visibility if needed. In the future, we may disallow
204
- empty labels by raising an exception.
203
+ For accessibility reasons, you should never set an empty label, but
204
+ you can hide it with ``label_visibility`` if needed. In the future,
205
+ we may disallow empty labels by raising an exception.
205
206
 
206
207
  .. |st.markdown| replace:: ``st.markdown``
207
208
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -230,7 +231,9 @@ class SelectSliderMixin:
230
231
  based on its content. No two widgets may have the same key.
231
232
 
232
233
  help : str
233
- An optional tooltip that gets displayed next to the select slider.
234
+ An optional tooltip that gets displayed next to the widget label.
235
+ Streamlit only displays the tooltip when
236
+ ``label_visibility="visible"``.
234
237
 
235
238
  on_change : callable
236
239
  An optional callback invoked when this select_slider's value changes.
@@ -242,14 +245,14 @@ class SelectSliderMixin:
242
245
  An optional dict of kwargs to pass to the callback.
243
246
 
244
247
  disabled : bool
245
- An optional boolean, which disables the select slider if set to True.
246
- The default is False.
248
+ An optional boolean that disables the select slider if set to
249
+ ``True``. The default is ``False``.
247
250
 
248
251
  label_visibility : "visible", "hidden", or "collapsed"
249
- The visibility of the label. If "hidden", the label doesn't show but there
250
- is still empty space for it above the widget (equivalent to label="").
251
- If "collapsed", both the label and the space are removed. Default is
252
- "visible".
252
+ The visibility of the label. The default is ``"visible"``. If this
253
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
254
+ label, which can help keep the widget alligned with other widgets.
255
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
253
256
 
254
257
  Returns
255
258
  -------
@@ -134,8 +134,9 @@ class SelectboxMixin:
134
134
  label : str
135
135
  A short label explaining to the user what this select widget is for.
136
136
  The label can optionally contain GitHub-flavored Markdown of the
137
- following types: Bold, Italics, Strikethroughs, Inline Code, and
138
- Links.
137
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
138
+ and Images. Images display like icons, with a max height equal to
139
+ the font height.
139
140
 
140
141
  Unsupported Markdown elements are unwrapped so only their children
141
142
  (text contents) render. Display unsupported elements as literal
@@ -145,9 +146,9 @@ class SelectboxMixin:
145
146
  See the ``body`` parameter of |st.markdown|_ for additional,
146
147
  supported Markdown directives.
147
148
 
148
- For accessibility reasons, you should never set an empty label (label="")
149
- but hide it with label_visibility if needed. In the future, we may disallow
150
- empty labels by raising an exception.
149
+ For accessibility reasons, you should never set an empty label, but
150
+ you can hide it with ``label_visibility`` if needed. In the future,
151
+ we may disallow empty labels by raising an exception.
151
152
 
152
153
  .. |st.markdown| replace:: ``st.markdown``
153
154
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -164,8 +165,10 @@ class SelectboxMixin:
164
165
  Defaults to 0 (the first option).
165
166
 
166
167
  format_func : function
167
- Function to modify the display of the labels. It receives the option
168
- as an argument and its output will be cast to str.
168
+ Function to modify the display of the options. It receives
169
+ the raw option as an argument and should output the label to be
170
+ shown for that option. This has no impact on the return value of
171
+ the command.
169
172
 
170
173
  key : str or int
171
174
  An optional string or integer to use as the unique key for the widget.
@@ -173,7 +176,9 @@ class SelectboxMixin:
173
176
  based on its content. No two widgets may have the same key.
174
177
 
175
178
  help : str
176
- An optional tooltip that gets displayed next to the selectbox.
179
+ An optional tooltip that gets displayed next to the widget label.
180
+ Streamlit only displays the tooltip when
181
+ ``label_visibility="visible"``.
177
182
 
178
183
  on_change : callable
179
184
  An optional callback invoked when this selectbox's value changes.
@@ -189,14 +194,14 @@ class SelectboxMixin:
189
194
  Defaults to "Choose an option".
190
195
 
191
196
  disabled : bool
192
- An optional boolean, which disables the selectbox if set to True.
193
- The default is False.
197
+ An optional boolean that disables the selectbox if set to ``True``.
198
+ The default is ``False``.
194
199
 
195
200
  label_visibility : "visible", "hidden", or "collapsed"
196
- The visibility of the label. If "hidden", the label doesn't show but there
197
- is still empty space for it above the widget (equivalent to label="").
198
- If "collapsed", both the label and the space are removed. Default is
199
- "visible".
201
+ The visibility of the label. The default is ``"visible"``. If this
202
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
203
+ label, which can help keep the widget alligned with other widgets.
204
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
200
205
 
201
206
  Returns
202
207
  -------
@@ -372,8 +372,9 @@ class SliderMixin:
372
372
  label : str
373
373
  A short label explaining to the user what this slider is for.
374
374
  The label can optionally contain GitHub-flavored Markdown of the
375
- following types: Bold, Italics, Strikethroughs, Inline Code, and
376
- Links.
375
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
376
+ and Images. Images display like icons, with a max height equal to
377
+ the font height.
377
378
 
378
379
  Unsupported Markdown elements are unwrapped so only their children
379
380
  (text contents) render. Display unsupported elements as literal
@@ -383,9 +384,9 @@ class SliderMixin:
383
384
  See the ``body`` parameter of |st.markdown|_ for additional,
384
385
  supported Markdown directives.
385
386
 
386
- For accessibility reasons, you should never set an empty label (label="")
387
- but hide it with label_visibility if needed. In the future, we may disallow
388
- empty labels by raising an exception.
387
+ For accessibility reasons, you should never set an empty label, but
388
+ you can hide it with ``label_visibility`` if needed. In the future,
389
+ we may disallow empty labels by raising an exception.
389
390
 
390
391
  .. |st.markdown| replace:: ``st.markdown``
391
392
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -426,7 +427,9 @@ class SliderMixin:
426
427
  based on its content. No two widgets may have the same key.
427
428
 
428
429
  help : str
429
- An optional tooltip that gets displayed next to the slider.
430
+ An optional tooltip that gets displayed next to the widget label.
431
+ Streamlit only displays the tooltip when
432
+ ``label_visibility="visible"``.
430
433
 
431
434
  on_change : callable
432
435
  An optional callback invoked when this slider's value changes.
@@ -438,14 +441,14 @@ class SliderMixin:
438
441
  An optional dict of kwargs to pass to the callback.
439
442
 
440
443
  disabled : bool
441
- An optional boolean, which disables the slider if set to True. The
442
- default is False.
444
+ An optional boolean that disables the slider if set to ``True``.
445
+ The default is ``False``.
443
446
 
444
447
  label_visibility : "visible", "hidden", or "collapsed"
445
- The visibility of the label. If "hidden", the label doesn't show but there
446
- is still empty space for it above the widget (equivalent to label="").
447
- If "collapsed", both the label and the space are removed. Default is
448
- "visible".
448
+ The visibility of the label. The default is ``"visible"``. If this
449
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
450
+ label, which can help keep the widget alligned with other widgets.
451
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
449
452
 
450
453
 
451
454
  Returns