streamlit-nightly 1.39.1.dev20241030__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 (41) 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/web/server/server.py +6 -1
  36. {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/METADATA +1 -1
  37. {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/RECORD +41 -40
  38. {streamlit_nightly-1.39.1.dev20241030.data → streamlit_nightly-1.39.1.dev20241101.data}/scripts/streamlit.cmd +0 -0
  39. {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/WHEEL +0 -0
  40. {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/entry_points.txt +0 -0
  41. {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/top_level.txt +0 -0
@@ -105,8 +105,9 @@ class ButtonMixin:
105
105
  label : str
106
106
  A short label explaining to the user what this button is for.
107
107
  The label can optionally contain GitHub-flavored Markdown of the
108
- following types: Bold, Italics, Strikethroughs, Inline Code, and
109
- Links.
108
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
109
+ and Images. Images display like icons, with a max height equal to
110
+ the font height.
110
111
 
111
112
  Unsupported Markdown elements are unwrapped so only their children
112
113
  (text contents) render. Display unsupported elements as literal
@@ -159,8 +160,8 @@ class ButtonMixin:
159
160
  font library.
160
161
 
161
162
  disabled : bool
162
- An optional boolean, which disables the button if set to True. The
163
- default is False.
163
+ An optional boolean that disables the button if set to ``True``.
164
+ The default is ``False``.
164
165
 
165
166
  use_container_width : bool
166
167
  Whether to expand the button's width to fill its parent container.
@@ -270,8 +271,9 @@ class ButtonMixin:
270
271
  label : str
271
272
  A short label explaining to the user what this button is for.
272
273
  The label can optionally contain GitHub-flavored Markdown of the
273
- following types: Bold, Italics, Strikethroughs, Inline Code, and
274
- Links.
274
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
275
+ and Images. Images display like icons, with a max height equal to
276
+ the font height.
275
277
 
276
278
  Unsupported Markdown elements are unwrapped so only their children
277
279
  (text contents) render. Display unsupported elements as literal
@@ -340,8 +342,8 @@ class ButtonMixin:
340
342
  font library.
341
343
 
342
344
  disabled : bool
343
- An optional boolean, which disables the download button if set to
344
- True. The default is False.
345
+ An optional boolean that disables the download button if set to
346
+ ``True``. The default is ``False``.
345
347
 
346
348
  use_container_width : bool
347
349
  Whether to expand the button's width to fill its parent container.
@@ -457,8 +459,9 @@ class ButtonMixin:
457
459
  label : str
458
460
  A short label explaining to the user what this button is for.
459
461
  The label can optionally contain GitHub-flavored Markdown of the
460
- following types: Bold, Italics, Strikethroughs, Inline Code, and
461
- Links.
462
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
463
+ and Images. Images display like icons, with a max height equal to
464
+ the font height.
462
465
 
463
466
  Unsupported Markdown elements are unwrapped so only their children
464
467
  (text contents) render. Display unsupported elements as literal
@@ -501,8 +504,8 @@ class ButtonMixin:
501
504
  font library.
502
505
 
503
506
  disabled : bool
504
- An optional boolean, which disables the link button if set to
505
- True. The default is False.
507
+ An optional boolean that disables the link button if set to
508
+ ``True``. The default is ``False``.
506
509
 
507
510
  use_container_width : bool
508
511
  Whether to expand the button's width to fill its parent container.
@@ -572,8 +575,9 @@ class ButtonMixin:
572
575
  label : str
573
576
  The label for the page link. Labels are required for external pages.
574
577
  The label can optionally contain GitHub-flavored Markdown of the
575
- following types: Bold, Italics, Strikethroughs, Inline Code, and
576
- Links.
578
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
579
+ and Images. Images display like icons, with a max height equal to
580
+ the font height.
577
581
 
578
582
  Unsupported Markdown elements are unwrapped so only their children
579
583
  (text contents) render. Display unsupported elements as literal
@@ -608,8 +612,8 @@ class ButtonMixin:
608
612
  hovered over.
609
613
 
610
614
  disabled : bool
611
- An optional boolean, which disables the page link if set to
612
- ``True``. The default is ``False``.
615
+ An optional boolean that disables the page link if set to ``True``.
616
+ The default is ``False``.
613
617
 
614
618
  use_container_width : bool
615
619
  Whether to expand the link's width to fill its parent container.
@@ -300,9 +300,8 @@ class ButtonGroupMixin:
300
300
  based on its content. No two widgets may have the same key.
301
301
 
302
302
  disabled : bool
303
- An optional boolean, which disables the feedback widget if set
304
- to True. The default is False. This argument can only be supplied
305
- by keyword.
303
+ An optional boolean that disables the feedback widget if set
304
+ to ``True``. The default is ``False``.
306
305
 
307
306
  on_change : callable
308
307
  An optional callback invoked when this feedback widget's value
@@ -440,16 +439,18 @@ class ButtonGroupMixin:
440
439
  ) -> list[V] | V | None:
441
440
  r"""Display a pills widget.
442
441
 
443
- A pills widget is similar to a single- or multiselect widget where the passed
444
- ``options`` are visually shown as pills-button.
442
+ A pills widget is similar to a ``st.selectbox`` or ``st.multiselect``
443
+ where the ``options`` are displayed as pill-buttons instead of a
444
+ drop-down list.
445
445
 
446
446
  Parameters
447
447
  ----------
448
- label : str
448
+ label: str
449
449
  A short label explaining to the user what this widget is for.
450
450
  The label can optionally contain GitHub-flavored Markdown of the
451
- following types: Bold, Italics, Strikethroughs, Inline Code, and
452
- Links.
451
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
452
+ and Images. Images display like icons, with a max height equal to
453
+ the font height.
453
454
 
454
455
  Unsupported Markdown elements are unwrapped so only their children
455
456
  (text contents) render. Display unsupported elements as literal
@@ -459,106 +460,116 @@ class ButtonGroupMixin:
459
460
  See the ``body`` parameter of |st.markdown|_ for additional,
460
461
  supported Markdown directives.
461
462
 
462
- For accessibility reasons, you should never set an empty label (label="")
463
- but hide it with label_visibility if needed. In the future, we may disallow
464
- empty labels by raising an exception.
463
+ For accessibility reasons, you should never set an empty label, but
464
+ you can hide it with ``label_visibility`` if needed. In the future,
465
+ we may disallow empty labels by raising an exception.
465
466
 
466
467
  .. |st.markdown| replace:: ``st.markdown``
467
468
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
468
469
 
469
- selection_mode: "single" or "multi"
470
- The selection mode for the widget. If "single", only one option can be
471
- selected. If "multi", multiple options can be selected.
472
-
473
470
  options: Iterable of V
474
471
  Labels for the select options in an ``Iterable``. This can be a
475
472
  ``list``, ``set``, or anything supported by ``st.dataframe``. If
476
473
  ``options`` is dataframe-like, the first column will be used. Each
477
474
  label will be cast to ``str`` internally by default.
478
475
 
476
+ selection_mode: "single" or "multi"
477
+ The selection mode for the widget. If this is ``"single"``
478
+ (default), only one option can be selected. If this is ``"multi"``,
479
+ multiple options can be selected.
480
+
479
481
  default: Iterable of V, V, or None
480
- List of default value or a single value. If the ``selection_mode``
481
- is "single", only a single value is allowed to be passed.
482
+ The value of the widget when it first renders. If the
483
+ ``selection_mode`` is ``multi``, this can be a list of values, a
484
+ single value, or ``None``. If the ``selection_mode`` is
485
+ ``"single"``, this can be a single value or ``None``.
482
486
 
483
- format_func : function
487
+ format_func: function
484
488
  Function to modify the display of the options. It receives
485
489
  the raw option as an argument and should output the label to be
486
490
  shown for that option. This has no impact on the return value of
487
491
  the command.
488
492
 
489
- key : str or int
493
+ key: str or int
490
494
  An optional string or integer to use as the unique key for the widget.
491
495
  If this is omitted, a key will be generated for the widget
492
496
  based on its content. Multiple widgets of the same type may
493
497
  not share the same key.
494
498
 
495
- help : str
496
- An optional tooltip that gets displayed next to the multiselect.
499
+ help: str
500
+ An optional tooltip that gets displayed next to the widget label.
501
+ Streamlit only displays the tooltip when
502
+ ``label_visibility="visible"``.
497
503
 
498
- on_change : callable
499
- An optional callback invoked when this feedback widget's value
500
- changes.
504
+ on_change: callable
505
+ An optional callback invoked when this widget's value changes.
501
506
 
502
- args : tuple
507
+ args: tuple
503
508
  An optional tuple of args to pass to the callback.
504
509
 
505
- kwargs : dict
510
+ kwargs: dict
506
511
  An optional dict of kwargs to pass to the callback.
507
512
 
508
- disabled : bool
509
- An optional boolean, which disables the widget if set
510
- to True. The default is False. This argument can only be supplied
511
- by keyword.
513
+ disabled: bool
514
+ An optional boolean that disables the widget if set to ``True``.
515
+ The default is ``False``.
512
516
 
513
- label_visibility : "visible", "hidden", or "collapsed"
514
- The visibility of the label. If "hidden", the label doesn't show but there
515
- is still empty space for it above the widget (equivalent to label="").
516
- If "collapsed", both the label and the space are removed. Default is
517
- "visible".
517
+ label_visibility: "visible", "hidden", or "collapsed"
518
+ The visibility of the label. The default is ``"visible"``. If this
519
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
520
+ label, which can help keep the widget alligned with other widgets.
521
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
518
522
 
519
523
  Returns
520
524
  -------
521
- list of V or V or None
522
- A list of selected options or an empty list if the ``selection_mode`` is
523
- "multi".
524
- If the "selection_mode" is "single", the return value is the selected option
525
- or None.
525
+ list of V, V, or None
526
+ If the ``selection_mode`` is ``multi``, this is a list of selected
527
+ options or an empty list. If the ``selection_mode`` is
528
+ ``"single"``, this is a selected option or ``None``.
526
529
 
527
530
  Examples
528
531
  --------
529
- Display a pills widget with multi select, and show the option:
532
+
533
+ **Example 1: Multi-select pills**
534
+
535
+ Display a multi-select pills widget, and show the selection:
530
536
 
531
537
  >>> import streamlit as st
532
538
  >>>
533
- >>> options = ["one", "two", "three", "four", "five"]
534
- >>> selection = st.pills(label="Numbered pills",
535
- options, selection_mode="multi")
536
- >>> st.markdown(f"You selected option: '{selection}'.")
539
+ >>> options = ["North", "East", "South", "West"]
540
+ >>> selection = st.pills("Directions", options, selection_mode="multi")
541
+ >>> st.markdown(f"Your selected options: {selection}.")
537
542
 
538
- .. output ::
539
- TBD
543
+ .. output::
544
+ https://doc-pills-multi.streamlit.app/
545
+ height: 200px
540
546
 
547
+ **Example 2: Single-select pills with icons**
541
548
 
542
- Display a pills widget that renders icons-only:
549
+ Display a single-select pills widget with icons:
543
550
 
544
551
  >>> import streamlit as st
545
552
  >>>
546
- >>> option_to_icon_map = {
547
- >>> 0: ":material/add:",
548
- >>> 1: ":material/zoom_in:",
549
- >>> 2: ":material/zoom_out:",
550
- >>> 3: ":material/zoom_out_map:",
551
- >>> }
553
+ >>> option_map = {
554
+ ... 0: ":material/add:",
555
+ ... 1: ":material/zoom_in:",
556
+ ... 2: ":material/zoom_out:",
557
+ ... 3: ":material/zoom_out_map:",
558
+ ... }
552
559
  >>> selection = st.pills(
553
- >>> "Icon-only pills",
554
- >>> options=option_to_icon_map.keys(),
555
- >>> format_func=lambda option: option_to_icon_map[option],
556
- >>> selection_mode="single",
557
- >>> )
558
- >>> st.write(f"Single selection: {selection}")
559
-
560
- .. output ::
561
- TBD
560
+ ... "Tool",
561
+ ... options=option_map.keys(),
562
+ ... format_func=lambda option: option_map[option],
563
+ ... selection_mode="single",
564
+ ... )
565
+ >>> st.write(
566
+ ... "Your selected option: "
567
+ ... f"{None if selection is None else option_map[selection]}"
568
+ ... )
569
+
570
+ .. output::
571
+ https://doc-pills-single.streamlit.app/
572
+ height: 200px
562
573
 
563
574
  """
564
575
  return self._internal_button_group(
@@ -631,16 +642,17 @@ class ButtonGroupMixin:
631
642
  ) -> list[V] | V | None:
632
643
  r"""Display a segmented control widget.
633
644
 
634
- A segmented control widget is a linear set of segments where each of the passed
635
- ``options`` functions as a button.
645
+ A segmented control widget is a linear set of segments where each of
646
+ the passed ``options`` functions like a toggle button.
636
647
 
637
648
  Parameters
638
649
  ----------
639
650
  label : str
640
651
  A short label explaining to the user what this widget is for.
641
652
  The label can optionally contain GitHub-flavored Markdown of the
642
- following types: Bold, Italics, Strikethroughs, Inline Code, and
643
- Links.
653
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
654
+ and Images. Images display like icons, with a max height equal to
655
+ the font height.
644
656
 
645
657
  Unsupported Markdown elements are unwrapped so only their children
646
658
  (text contents) render. Display unsupported elements as literal
@@ -650,106 +662,119 @@ class ButtonGroupMixin:
650
662
  See the ``body`` parameter of |st.markdown|_ for additional,
651
663
  supported Markdown directives.
652
664
 
653
- For accessibility reasons, you should never set an empty label (label="")
654
- but hide it with label_visibility if needed. In the future, we may disallow
655
- empty labels by raising an exception.
665
+ For accessibility reasons, you should never set an empty label, but
666
+ you can hide it with ``label_visibility`` if needed. In the future,
667
+ we may disallow empty labels by raising an exception.
656
668
 
657
669
  .. |st.markdown| replace:: ``st.markdown``
658
670
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
659
671
 
660
- selection_mode: "single" or "multi"
661
- The selection mode for the widget. If "single", only one option can be
662
- selected. If "multi", multiple options can be selected.
663
-
664
672
  options: Iterable of V
665
673
  Labels for the select options in an ``Iterable``. This can be a
666
674
  ``list``, ``set``, or anything supported by ``st.dataframe``. If
667
675
  ``options`` is dataframe-like, the first column will be used. Each
668
676
  label will be cast to ``str`` internally by default.
669
677
 
678
+ selection_mode: "single" or "multi"
679
+ The selection mode for the widget. If this is ``"single"``
680
+ (default), only one option can be selected. If this is ``"multi"``,
681
+ multiple options can be selected.
682
+
670
683
  default: Iterable of V, V, or None
671
- List of default value or a single value. If the ``selection_mode``
672
- is "single", only a single value is allowed to be passed.
684
+ The value of the widget when it first renders. If the
685
+ ``selection_mode`` is ``multi``, this can be a list of values, a
686
+ single value, or ``None``. If the ``selection_mode`` is
687
+ ``"single"``, this can be a single value or ``None``.
673
688
 
674
- format_func : function
689
+ format_func: function
675
690
  Function to modify the display of the options. It receives
676
691
  the raw option as an argument and should output the label to be
677
692
  shown for that option. This has no impact on the return value of
678
693
  the command.
679
694
 
680
- key : str or int
695
+ key: str or int
681
696
  An optional string or integer to use as the unique key for the widget.
682
697
  If this is omitted, a key will be generated for the widget
683
698
  based on its content. Multiple widgets of the same type may
684
699
  not share the same key.
685
700
 
686
- help : str
687
- An optional tooltip that gets displayed next to the multiselect.
701
+ help: str
702
+ An optional tooltip that gets displayed next to the widget label.
703
+ Streamlit only displays the tooltip when
704
+ ``label_visibility="visible"``.
688
705
 
689
- on_change : callable
690
- An optional callback invoked when this feedback widget's value
691
- changes.
706
+ on_change: callable
707
+ An optional callback invoked when this widget's value changes.
692
708
 
693
- args : tuple
709
+ args: tuple
694
710
  An optional tuple of args to pass to the callback.
695
711
 
696
- kwargs : dict
712
+ kwargs: dict
697
713
  An optional dict of kwargs to pass to the callback.
698
714
 
699
- disabled : bool
700
- An optional boolean, which disables the widget if set
701
- to True. The default is False. This argument can only be supplied
702
- by keyword.
715
+ disabled: bool
716
+ An optional boolean that disables the widget if set to ``True``.
717
+ The default is ``False``.
703
718
 
704
- label_visibility : "visible", "hidden", or "collapsed"
705
- The visibility of the label. If "hidden", the label doesn't show but there
706
- is still empty space for it above the widget (equivalent to label="").
707
- If "collapsed", both the label and the space are removed. Default is
708
- "visible".
719
+ label_visibility: "visible", "hidden", or "collapsed"
720
+ The visibility of the label. The default is ``"visible"``. If this
721
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
722
+ label, which can help keep the widget alligned with other widgets.
723
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
709
724
 
710
725
  Returns
711
726
  -------
712
- list of V or V or None
713
- A list of selected options or an empty list if the ``selection_mode`` is
714
- "multi".
715
- If the "selection_mode" is "single", the return value is the selected option
716
- or None.
727
+ list of V, V, or None
728
+ If the ``selection_mode`` is ``multi``, this is a list of selected
729
+ options or an empty list. If the ``selection_mode`` is
730
+ ``"single"``, this is a selected option or ``None``.
717
731
 
718
732
  Examples
719
733
  --------
720
- Display a segmented control widget with multi select, and show the option:
734
+
735
+ **Example 1: Multi-select segmented control**
736
+
737
+ Display a multi-select segmented control widget, and show the
738
+ selection:
721
739
 
722
740
  >>> import streamlit as st
723
741
  >>>
724
742
  >>> options = ["North", "East", "South", "West"]
725
- >>> selection = st.segmented_control(label="Directions",
726
- options, selection_mode="multi")
727
- >>> st.markdown(f"You selected options: '{selection}'.")
743
+ >>> selection = st.segmented_control(
744
+ ... "Directions", options, selection_mode="multi"
745
+ ... )
746
+ >>> st.markdown(f"Your selected options: {selection}.")
728
747
 
729
- .. output ::
730
- TBD
748
+ .. output::
749
+ https://doc-segmented-control-multi.streamlit.app/
750
+ height: 200px
731
751
 
752
+ **Example 2: Single-select segmented control with icons**
732
753
 
733
- Display a segmented control widget that renders icons-only:
754
+ Display a single-select segmented control widget with icons:
734
755
 
735
756
  >>> import streamlit as st
736
757
  >>>
737
- >>> option_to_icon_map = {
738
- >>> 0: ":material/add:",
739
- >>> 1: ":material/zoom_in:",
740
- >>> 2: ":material/zoom_out:",
741
- >>> 3: ":material/zoom_out_map:",
742
- >>> }
758
+ >>> option_map = {
759
+ ... 0: ":material/add:",
760
+ ... 1: ":material/zoom_in:",
761
+ ... 2: ":material/zoom_out:",
762
+ ... 3: ":material/zoom_out_map:",
763
+ ... }
743
764
  >>> selection = st.segmented_control(
744
- >>> "Icon-only segmented control",
745
- >>> options=option_to_icon_map.keys(),
746
- >>> format_func=lambda option: option_to_icon_map[option],
747
- >>> selection_mode="single",
748
- >>> )
749
- >>> st.write(f"Single selection: {selection}")
750
-
751
- .. output ::
752
- TBD
765
+ ... "Tool",
766
+ ... options=option_map.keys(),
767
+ ... format_func=lambda option: option_map[option],
768
+ ... selection_mode="single",
769
+ ... )
770
+ >>> st.write(
771
+ ... "Your selected option: "
772
+ ... f"{None if selection is None else option_map[selection]}"
773
+ ... )
774
+
775
+ .. output::
776
+ https://doc-segmented-control-single.streamlit.app/
777
+ height: 200px
753
778
 
754
779
  """
755
780
  return self._internal_button_group(
@@ -103,8 +103,9 @@ class CameraInputMixin:
103
103
  label : str
104
104
  A short label explaining to the user what this widget is used for.
105
105
  The label can optionally contain GitHub-flavored Markdown of the
106
- following types: Bold, Italics, Strikethroughs, Inline Code, and
107
- Links.
106
+ following types: Bold, Italics, Strikethroughs, Inline Code, Links,
107
+ and Images. Images display like icons, with a max height equal to
108
+ the font height.
108
109
 
109
110
  Unsupported Markdown elements are unwrapped so only their children
110
111
  (text contents) render. Display unsupported elements as literal
@@ -114,9 +115,9 @@ class CameraInputMixin:
114
115
  See the ``body`` parameter of |st.markdown|_ for additional,
115
116
  supported Markdown directives.
116
117
 
117
- For accessibility reasons, you should never set an empty label (label="")
118
- but hide it with label_visibility if needed. In the future, we may disallow
119
- empty labels by raising an exception.
118
+ For accessibility reasons, you should never set an empty label, but
119
+ you can hide it with ``label_visibility`` if needed. In the future,
120
+ we may disallow empty labels by raising an exception.
120
121
 
121
122
  .. |st.markdown| replace:: ``st.markdown``
122
123
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
@@ -140,13 +141,14 @@ class CameraInputMixin:
140
141
  An optional dict of kwargs to pass to the callback.
141
142
 
142
143
  disabled : bool
143
- An optional boolean, which disables the camera input if set to
144
- True. Default is False.
144
+ An optional boolean that disables the camera input if set to
145
+ ``True``. Default is ``False``.
146
+
145
147
  label_visibility : "visible", "hidden", or "collapsed"
146
- The visibility of the label. If "hidden", the label doesn't show but there
147
- is still empty space for it above the widget (equivalent to label="").
148
- If "collapsed", both the label and the space are removed. Default is
149
- "visible".
148
+ The visibility of the label. The default is ``"visible"``. If this
149
+ is ``"hidden"``, Streamlit displays an empty spacer instead of the
150
+ label, which can help keep the widget alligned with other widgets.
151
+ If this is ``"collapsed"``, Streamlit displays no label or spacer.
150
152
 
151
153
  Returns
152
154
  -------
@@ -20,8 +20,8 @@ from typing import TYPE_CHECKING, Literal, cast
20
20
 
21
21
  from streamlit import runtime
22
22
  from streamlit.delta_generator_singletons import get_dg_singleton_instance
23
- from streamlit.elements.image import AtomicImage, WidthBehaviour, image_to_url
24
23
  from streamlit.elements.lib.form_utils import is_in_form
24
+ from streamlit.elements.lib.image_utils import AtomicImage, WidthBehavior, image_to_url
25
25
  from streamlit.elements.lib.policies import check_widget_policies
26
26
  from streamlit.elements.lib.utils import (
27
27
  Key,
@@ -96,7 +96,7 @@ def _process_avatar_input(
96
96
  try:
97
97
  return AvatarType.IMAGE, image_to_url(
98
98
  avatar,
99
- width=WidthBehaviour.ORIGINAL,
99
+ width=WidthBehavior.ORIGINAL,
100
100
  clamp=False,
101
101
  channels="RGB",
102
102
  output_format="auto",