streamlit-nightly 1.36.1.dev20240721__py2.py3-none-any.whl → 1.36.1.dev20240723__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 (42) hide show
  1. streamlit/commands/execution_control.py +17 -12
  2. streamlit/config.py +8 -4
  3. streamlit/elements/alert.py +6 -6
  4. streamlit/elements/dialog_decorator.py +1 -0
  5. streamlit/elements/heading.py +29 -52
  6. streamlit/elements/layouts.py +44 -83
  7. streamlit/elements/markdown.py +12 -17
  8. streamlit/elements/metric.py +19 -24
  9. streamlit/elements/progress.py +10 -20
  10. streamlit/elements/toast.py +6 -16
  11. streamlit/elements/vega_charts.py +49 -12
  12. streamlit/elements/widgets/button.py +74 -81
  13. streamlit/elements/widgets/button_group.py +50 -22
  14. streamlit/elements/widgets/camera_input.py +12 -21
  15. streamlit/elements/widgets/checkbox.py +40 -42
  16. streamlit/elements/widgets/color_picker.py +20 -21
  17. streamlit/elements/widgets/file_uploader.py +13 -21
  18. streamlit/elements/widgets/multiselect.py +24 -22
  19. streamlit/elements/widgets/number_input.py +31 -25
  20. streamlit/elements/widgets/radio.py +24 -21
  21. streamlit/elements/widgets/select_slider.py +22 -21
  22. streamlit/elements/widgets/selectbox.py +23 -21
  23. streamlit/elements/widgets/slider.py +24 -21
  24. streamlit/elements/widgets/text_widgets.py +48 -43
  25. streamlit/elements/widgets/time_widgets.py +44 -42
  26. streamlit/runtime/context.py +55 -7
  27. streamlit/runtime/fragment.py +3 -4
  28. streamlit/runtime/scriptrunner/magic.py +25 -12
  29. streamlit/static/asset-manifest.json +3 -3
  30. streamlit/static/index.html +1 -1
  31. streamlit/static/static/js/7175.2779947a.chunk.js +1 -0
  32. streamlit/static/static/js/main.94c2fada.js +2 -0
  33. streamlit/testing/v1/app_test.py +10 -0
  34. {streamlit_nightly-1.36.1.dev20240721.dist-info → streamlit_nightly-1.36.1.dev20240723.dist-info}/METADATA +1 -1
  35. {streamlit_nightly-1.36.1.dev20240721.dist-info → streamlit_nightly-1.36.1.dev20240723.dist-info}/RECORD +40 -40
  36. streamlit/static/static/js/7175.4cdaec13.chunk.js +0 -1
  37. streamlit/static/static/js/main.d55f6a3c.js +0 -2
  38. /streamlit/static/static/js/{main.d55f6a3c.js.LICENSE.txt → main.94c2fada.js.LICENSE.txt} +0 -0
  39. {streamlit_nightly-1.36.1.dev20240721.data → streamlit_nightly-1.36.1.dev20240723.data}/scripts/streamlit.cmd +0 -0
  40. {streamlit_nightly-1.36.1.dev20240721.dist-info → streamlit_nightly-1.36.1.dev20240723.dist-info}/WHEEL +0 -0
  41. {streamlit_nightly-1.36.1.dev20240721.dist-info → streamlit_nightly-1.36.1.dev20240723.dist-info}/entry_points.txt +0 -0
  42. {streamlit_nightly-1.36.1.dev20240721.dist-info → streamlit_nightly-1.36.1.dev20240723.dist-info}/top_level.txt +0 -0
@@ -76,52 +76,51 @@ class CheckboxMixin:
76
76
  ----------
77
77
  label : str
78
78
  A short label explaining to the user what this checkbox is for.
79
- The label can optionally contain Markdown and supports the following
80
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
79
+ The label can optionally contain GitHub-flavored Markdown of the
80
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
81
+ Links.
81
82
 
82
- This also supports:
83
+ Unsupported Markdown elements are unwrapped so only their children
84
+ (text contents) render. Display unsupported elements as literal
85
+ characters by backslash-escaping them. E.g.,
86
+ ``"1\. Not an ordered list"``.
83
87
 
84
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
85
- For a list of all supported codes,
86
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
87
-
88
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
89
- must be on their own lines). Supported LaTeX functions are listed
90
- at https://katex.org/docs/supported.html.
91
-
92
- * Colored text and background colors for text, using the syntax
93
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
94
- respectively. ``color`` must be replaced with any of the following
95
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
96
- For example, you can use ``:orange[your text here]`` or
97
- ``:blue-background[your text here]``.
98
-
99
- Unsupported elements are unwrapped so only their children (text contents) render.
100
- Display unsupported elements as literal characters by
101
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
88
+ See the ``body`` parameter of |st.markdown|_ for additional,
89
+ supported Markdown directives.
102
90
 
103
91
  For accessibility reasons, you should never set an empty label (label="")
104
92
  but hide it with label_visibility if needed. In the future, we may disallow
105
93
  empty labels by raising an exception.
94
+
95
+ .. |st.markdown| replace:: ``st.markdown``
96
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
97
+
106
98
  value : bool
107
99
  Preselect the checkbox when it first renders. This will be
108
100
  cast to bool internally.
101
+
109
102
  key : str or int
110
103
  An optional string or integer to use as the unique key for the widget.
111
104
  If this is omitted, a key will be generated for the widget
112
105
  based on its content. Multiple widgets of the same type may
113
106
  not share the same key.
107
+
114
108
  help : str
115
109
  An optional tooltip that gets displayed next to the checkbox.
110
+
116
111
  on_change : callable
117
112
  An optional callback invoked when this checkbox's value changes.
113
+
118
114
  args : tuple
119
115
  An optional tuple of args to pass to the callback.
116
+
120
117
  kwargs : dict
121
118
  An optional dict of kwargs to pass to the callback.
119
+
122
120
  disabled : bool
123
121
  An optional boolean, which disables the checkbox if set to True.
124
122
  The default is False.
123
+
125
124
  label_visibility : "visible", "hidden", or "collapsed"
126
125
  The visibility of the label. If "hidden", the label doesn't show but there
127
126
  is still empty space for it (equivalent to label="").
@@ -182,52 +181,51 @@ class CheckboxMixin:
182
181
  ----------
183
182
  label : str
184
183
  A short label explaining to the user what this toggle is for.
185
- The label can optionally contain Markdown and supports the following
186
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
184
+ The label can optionally contain GitHub-flavored Markdown of the
185
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
186
+ Links.
187
187
 
188
- This also supports:
188
+ Unsupported Markdown elements are unwrapped so only their children
189
+ (text contents) render. Display unsupported elements as literal
190
+ characters by backslash-escaping them. E.g.,
191
+ ``"1\. Not an ordered list"``.
189
192
 
190
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
191
- For a list of all supported codes,
192
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
193
-
194
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
195
- must be on their own lines). Supported LaTeX functions are listed
196
- at https://katex.org/docs/supported.html.
197
-
198
- * Colored text and background colors for text, using the syntax
199
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
200
- respectively. ``color`` must be replaced with any of the following
201
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
202
- For example, you can use ``:orange[your text here]`` or
203
- ``:blue-background[your text here]``.
204
-
205
- Unsupported elements are unwrapped so only their children (text contents) render.
206
- Display unsupported elements as literal characters by
207
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
193
+ See the ``body`` parameter of |st.markdown|_ for additional,
194
+ supported Markdown directives.
208
195
 
209
196
  For accessibility reasons, you should never set an empty label (label="")
210
197
  but hide it with label_visibility if needed. In the future, we may disallow
211
198
  empty labels by raising an exception.
199
+
200
+ .. |st.markdown| replace:: ``st.markdown``
201
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
202
+
212
203
  value : bool
213
204
  Preselect the toggle when it first renders. This will be
214
205
  cast to bool internally.
206
+
215
207
  key : str or int
216
208
  An optional string or integer to use as the unique key for the widget.
217
209
  If this is omitted, a key will be generated for the widget
218
210
  based on its content. Multiple widgets of the same type may
219
211
  not share the same key.
212
+
220
213
  help : str
221
214
  An optional tooltip that gets displayed next to the toggle.
215
+
222
216
  on_change : callable
223
217
  An optional callback invoked when this toggle's value changes.
218
+
224
219
  args : tuple
225
220
  An optional tuple of args to pass to the callback.
221
+
226
222
  kwargs : dict
227
223
  An optional dict of kwargs to pass to the callback.
224
+
228
225
  disabled : bool
229
226
  An optional boolean, which disables the toggle if set to True.
230
227
  The default is False.
228
+
231
229
  label_visibility : "visible", "hidden", or "collapsed"
232
230
  The visibility of the label. If "hidden", the label doesn't show but there
233
231
  is still empty space for it (equivalent to label="").
@@ -78,54 +78,53 @@ class ColorPickerMixin:
78
78
  ----------
79
79
  label : str
80
80
  A short label explaining to the user what this input is for.
81
- The label can optionally contain Markdown and supports the following
82
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
81
+ The label can optionally contain GitHub-flavored Markdown of the
82
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
83
+ Links.
83
84
 
84
- This also supports:
85
+ Unsupported Markdown elements are unwrapped so only their children
86
+ (text contents) render. Display unsupported elements as literal
87
+ characters by backslash-escaping them. E.g.,
88
+ ``"1\. Not an ordered list"``.
85
89
 
86
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
87
- For a list of all supported codes,
88
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
89
-
90
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
91
- must be on their own lines). Supported LaTeX functions are listed
92
- at https://katex.org/docs/supported.html.
93
-
94
- * Colored text and background colors for text, using the syntax
95
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
96
- respectively. ``color`` must be replaced with any of the following
97
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
98
- For example, you can use ``:orange[your text here]`` or
99
- ``:blue-background[your text here]``.
100
-
101
- Unsupported elements are unwrapped so only their children (text contents) render.
102
- Display unsupported elements as literal characters by
103
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
90
+ See the ``body`` parameter of |st.markdown|_ for additional,
91
+ supported Markdown directives.
104
92
 
105
93
  For accessibility reasons, you should never set an empty label (label="")
106
94
  but hide it with label_visibility if needed. In the future, we may disallow
107
95
  empty labels by raising an exception.
96
+
97
+ .. |st.markdown| replace:: ``st.markdown``
98
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
99
+
108
100
  value : str
109
101
  The hex value of this widget when it first renders. If None,
110
102
  defaults to black.
103
+
111
104
  key : str or int
112
105
  An optional string or integer to use as the unique key for the widget.
113
106
  If this is omitted, a key will be generated for the widget
114
107
  based on its content. Multiple widgets of the same type may
115
108
  not share the same key.
109
+
116
110
  help : str
117
111
  An optional tooltip that gets displayed next to the color picker.
112
+
118
113
  on_change : callable
119
114
  An optional callback invoked when this color_picker's value
120
115
  changes.
116
+
121
117
  args : tuple
122
118
  An optional tuple of args to pass to the callback.
119
+
123
120
  kwargs : dict
124
121
  An optional dict of kwargs to pass to the callback.
122
+
125
123
  disabled : bool
126
124
  An optional boolean, which disables the color picker if set to
127
125
  True. The default is False. This argument can only be supplied by
128
126
  keyword.
127
+
129
128
  label_visibility : "visible", "hidden", or "collapsed"
130
129
  The visibility of the label. If "hidden", the label doesn't show but there
131
130
  is still empty space for it above the widget (equivalent to label="").
@@ -250,34 +250,25 @@ class FileUploaderMixin:
250
250
  ----------
251
251
  label : str
252
252
  A short label explaining to the user what this file uploader is for.
253
- The label can optionally contain Markdown and supports the following
254
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
253
+ The label can optionally contain GitHub-flavored Markdown of the
254
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
255
+ Links.
255
256
 
256
- This also supports:
257
+ Unsupported Markdown elements are unwrapped so only their children
258
+ (text contents) render. Display unsupported elements as literal
259
+ characters by backslash-escaping them. E.g.,
260
+ ``"1\. Not an ordered list"``.
257
261
 
258
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
259
- For a list of all supported codes,
260
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
261
-
262
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
263
- must be on their own lines). Supported LaTeX functions are listed
264
- at https://katex.org/docs/supported.html.
265
-
266
- * Colored text and background colors for text, using the syntax
267
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
268
- respectively. ``color`` must be replaced with any of the following
269
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
270
- For example, you can use ``:orange[your text here]`` or
271
- ``:blue-background[your text here]``.
272
-
273
- Unsupported elements are unwrapped so only their children (text contents) render.
274
- Display unsupported elements as literal characters by
275
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
262
+ See the ``body`` parameter of |st.markdown|_ for additional,
263
+ supported Markdown directives.
276
264
 
277
265
  For accessibility reasons, you should never set an empty label (label="")
278
266
  but hide it with label_visibility if needed. In the future, we may disallow
279
267
  empty labels by raising an exception.
280
268
 
269
+ .. |st.markdown| replace:: ``st.markdown``
270
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
271
+
281
272
  type : str or list of str or None
282
273
  Array of allowed extensions. ['png', 'jpg']
283
274
  The default is None, which means all extensions are allowed.
@@ -310,6 +301,7 @@ class FileUploaderMixin:
310
301
  An optional boolean, which disables the file uploader if set to
311
302
  True. The default is False. This argument can only be supplied by
312
303
  keyword.
304
+
313
305
  label_visibility : "visible", "hidden", or "collapsed"
314
306
  The visibility of the label. If "hidden", the label doesn't show but there
315
307
  is still empty space for it above the widget (equivalent to label="").
@@ -136,68 +136,70 @@ class MultiSelectMixin:
136
136
  ----------
137
137
  label : str
138
138
  A short label explaining to the user what this select widget is for.
139
- The label can optionally contain Markdown and supports the following
140
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
139
+ The label can optionally contain GitHub-flavored Markdown of the
140
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
141
+ Links.
141
142
 
142
- This also supports:
143
+ Unsupported Markdown elements are unwrapped so only their children
144
+ (text contents) render. Display unsupported elements as literal
145
+ characters by backslash-escaping them. E.g.,
146
+ ``"1\. Not an ordered list"``.
143
147
 
144
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
145
- For a list of all supported codes,
146
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
147
-
148
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
149
- must be on their own lines). Supported LaTeX functions are listed
150
- at https://katex.org/docs/supported.html.
151
-
152
- * Colored text and background colors for text, using the syntax
153
- ``:color[text to be colored]`` and
154
- ``:color-background[text to be colored]``, respectively.
155
- ``color`` must be replaced with any of the following
156
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
157
- For example, you can use ``:orange[your text here]`` or
158
- ``:blue-background[your text here]``.
159
-
160
- Unsupported elements are unwrapped so only their children (text contents)
161
- render. Display unsupported elements as literal characters by
162
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
148
+ See the ``body`` parameter of |st.markdown|_ for additional,
149
+ supported Markdown directives.
163
150
 
164
151
  For accessibility reasons, you should never set an empty label (label="")
165
152
  but hide it with label_visibility if needed. In the future, we may disallow
166
153
  empty labels by raising an exception.
154
+
155
+ .. |st.markdown| replace:: ``st.markdown``
156
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
157
+
167
158
  options : Iterable
168
159
  Labels for the select options in an Iterable. For example, this can
169
160
  be a list, numpy.ndarray, pandas.Series, pandas.DataFrame, or
170
161
  pandas.Index. For pandas.DataFrame, the first column is used.
171
162
  Each label will be cast to str internally by default.
163
+
172
164
  default: Iterable of V, V, or None
173
165
  List of default values. Can also be a single value.
166
+
174
167
  format_func : function
175
168
  Function to modify the display of selectbox options. It receives
176
169
  the raw option as an argument and should output the label to be
177
170
  shown for that option. This has no impact on the return value of
178
171
  the multiselect.
172
+
179
173
  key : str or int
180
174
  An optional string or integer to use as the unique key for the widget.
181
175
  If this is omitted, a key will be generated for the widget
182
176
  based on its content. Multiple widgets of the same type may
183
177
  not share the same key.
178
+
184
179
  help : str
185
180
  An optional tooltip that gets displayed next to the multiselect.
181
+
186
182
  on_change : callable
187
183
  An optional callback invoked when this multiselect's value changes.
184
+
188
185
  args : tuple
189
186
  An optional tuple of args to pass to the callback.
187
+
190
188
  kwargs : dict
191
189
  An optional dict of kwargs to pass to the callback.
190
+
192
191
  max_selections : int
193
192
  The max selections that can be selected at a time.
193
+
194
194
  placeholder : str
195
195
  A string to display when no options are selected.
196
196
  Defaults to 'Choose an option'.
197
+
197
198
  disabled : bool
198
199
  An optional boolean, which disables the multiselect widget if set
199
200
  to True. The default is False. This argument can only be supplied
200
201
  by keyword.
202
+
201
203
  label_visibility : "visible", "hidden", or "collapsed"
202
204
  The visibility of the label. If "hidden", the label doesn't show but there
203
205
  is still empty space for it above the widget (equivalent to label="").
@@ -146,73 +146,79 @@ class NumberInputMixin:
146
146
  ----------
147
147
  label : str
148
148
  A short label explaining to the user what this input is for.
149
- The label can optionally contain Markdown and supports the following
150
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
149
+ The label can optionally contain GitHub-flavored Markdown of the
150
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
151
+ Links.
151
152
 
152
- This also supports:
153
+ Unsupported Markdown elements are unwrapped so only their children
154
+ (text contents) render. Display unsupported elements as literal
155
+ characters by backslash-escaping them. E.g.,
156
+ ``"1\. Not an ordered list"``.
153
157
 
154
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
155
- For a list of all supported codes,
156
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
157
-
158
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
159
- must be on their own lines). Supported LaTeX functions are listed
160
- at https://katex.org/docs/supported.html.
161
-
162
- * Colored text and background colors for text, using the syntax
163
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
164
- respectively. ``color`` must be replaced with any of the following
165
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
166
- For example, you can use ``:orange[your text here]`` or
167
- ``:blue-background[your text here]``.
168
-
169
- Unsupported elements are unwrapped so only their children (text contents) render.
170
- Display unsupported elements as literal characters by
171
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
158
+ See the ``body`` parameter of |st.markdown|_ for additional,
159
+ supported Markdown directives.
172
160
 
173
161
  For accessibility reasons, you should never set an empty label (label="")
174
162
  but hide it with label_visibility if needed. In the future, we may disallow
175
163
  empty labels by raising an exception.
164
+
165
+ .. |st.markdown| replace:: ``st.markdown``
166
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
167
+
176
168
  min_value : int, float, or None
177
169
  The minimum permitted value.
178
170
  If None, there will be no minimum.
171
+
179
172
  max_value : int, float, or None
180
173
  The maximum permitted value.
181
174
  If None, there will be no maximum.
175
+
182
176
  value : int, float, "min" or None
183
177
  The value of this widget when it first renders. If ``None``, will initialize
184
178
  empty and return ``None`` until the user provides input.
185
179
  If "min" (default), will initialize with min_value, or 0.0 if
186
180
  min_value is None.
181
+
187
182
  step : int, float, or None
188
183
  The stepping interval.
189
184
  Defaults to 1 if the value is an int, 0.01 otherwise.
190
185
  If the value is not specified, the format parameter will be used.
186
+
191
187
  format : str or None
192
188
  A printf-style format string controlling how the interface should
193
- display numbers. Output must be purely numeric. This does not impact
194
- the return value. Formatting is handled by [sprintf.js](https://github.com/alexei/sprintf.js).
195
- This can be used to adjust decimal precision in the displayed result. For example,
196
- ``'%0.1f'`` to only show 1 digit after the decimal.
189
+ display numbers. The output must be purely numeric. This does not
190
+ impact the return value of the widget. Formatting is handled by
191
+ `sprintf.js <https://github.com/alexei/sprintf.js>`_.
192
+
193
+ For example, ``format="%0.1f"`` adjusts the displayed decimal
194
+ precision to only show one digit after the decimal.
195
+
197
196
  key : str or int
198
197
  An optional string or integer to use as the unique key for the widget.
199
198
  If this is omitted, a key will be generated for the widget
200
199
  based on its content. Multiple widgets of the same type may
201
200
  not share the same key.
201
+
202
202
  help : str
203
203
  An optional tooltip that gets displayed next to the input.
204
+
204
205
  on_change : callable
205
206
  An optional callback invoked when this number_input's value changes.
207
+
206
208
  args : tuple
207
209
  An optional tuple of args to pass to the callback.
210
+
208
211
  kwargs : dict
209
212
  An optional dict of kwargs to pass to the callback.
213
+
210
214
  placeholder : str or None
211
215
  An optional string displayed when the number input is empty.
212
216
  If None, no placeholder is displayed.
217
+
213
218
  disabled : bool
214
219
  An optional boolean, which disables the number input if set to
215
220
  True. The default is False.
221
+
216
222
  label_visibility : "visible", "hidden", or "collapsed"
217
223
  The visibility of the label. If "hidden", the label doesn't show but there
218
224
  is still empty space for it above the widget (equivalent to label="").
@@ -105,33 +105,25 @@ class RadioMixin:
105
105
  ----------
106
106
  label : str
107
107
  A short label explaining to the user what this radio group is for.
108
- The label can optionally contain Markdown and supports the following
109
- elements: Bold, Italics, Strikethroughs, Inline Code, Emojis, and Links.
108
+ The label can optionally contain GitHub-flavored Markdown of the
109
+ following types: Bold, Italics, Strikethroughs, Inline Code, and
110
+ Links.
110
111
 
111
- This also supports:
112
+ Unsupported Markdown elements are unwrapped so only their children
113
+ (text contents) render. Display unsupported elements as literal
114
+ characters by backslash-escaping them. E.g.,
115
+ ``"1\. Not an ordered list"``.
112
116
 
113
- * Emoji shortcodes, such as ``:+1:`` and ``:sunglasses:``.
114
- For a list of all supported codes,
115
- see https://share.streamlit.io/streamlit/emoji-shortcodes.
116
-
117
- * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
118
- must be on their own lines). Supported LaTeX functions are listed
119
- at https://katex.org/docs/supported.html.
120
-
121
- * Colored text and background colors for text, using the syntax
122
- ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
123
- respectively. ``color`` must be replaced with any of the following
124
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
125
- For example, you can use ``:orange[your text here]`` or
126
- ``:blue-background[your text here]``.
127
-
128
- Unsupported elements are unwrapped so only their children (text contents) render.
129
- Display unsupported elements as literal characters by
130
- backslash-escaping them. E.g. ``1\. Not an ordered list``.
117
+ See the ``body`` parameter of |st.markdown|_ for additional,
118
+ supported Markdown directives.
131
119
 
132
120
  For accessibility reasons, you should never set an empty label (label="")
133
121
  but hide it with label_visibility if needed. In the future, we may disallow
134
122
  empty labels by raising an exception.
123
+
124
+ .. |st.markdown| replace:: ``st.markdown``
125
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
126
+
135
127
  options : Iterable
136
128
  Labels for the select options in an Iterable. For example, this can
137
129
  be a list, numpy.ndarray, pandas.Series, pandas.DataFrame, or
@@ -139,37 +131,48 @@ class RadioMixin:
139
131
 
140
132
  Labels can include markdown as described in the ``label`` parameter
141
133
  and will be cast to str internally by default.
134
+
142
135
  index : int or None
143
136
  The index of the preselected option on first render. If ``None``,
144
137
  will initialize empty and return ``None`` until the user selects an option.
145
138
  Defaults to 0 (the first option).
139
+
146
140
  format_func : function
147
141
  Function to modify the display of radio options. It receives
148
142
  the raw option as an argument and should output the label to be
149
143
  shown for that option. This has no impact on the return value of
150
144
  the radio.
145
+
151
146
  key : str or int
152
147
  An optional string or integer to use as the unique key for the widget.
153
148
  If this is omitted, a key will be generated for the widget
154
149
  based on its content. Multiple widgets of the same type may
155
150
  not share the same key.
151
+
156
152
  help : str
157
153
  An optional tooltip that gets displayed next to the radio.
154
+
158
155
  on_change : callable
159
156
  An optional callback invoked when this radio's value changes.
157
+
160
158
  args : tuple
161
159
  An optional tuple of args to pass to the callback.
160
+
162
161
  kwargs : dict
163
162
  An optional dict of kwargs to pass to the callback.
163
+
164
164
  disabled : bool
165
165
  An optional boolean, which disables the radio button if set to
166
166
  True. The default is False.
167
+
167
168
  horizontal : bool
168
169
  An optional boolean, which orients the radio group horizontally.
169
170
  The default is false (vertical buttons).
171
+
170
172
  captions : iterable of str or None
171
173
  A list of captions to show below each radio button. If None (default),
172
174
  no captions are shown.
175
+
173
176
  label_visibility : "visible", "hidden", or "collapsed"
174
177
  The visibility of the label. If "hidden", the label doesn't show but there
175
178
  is still empty space for it above the widget (equivalent to label="").