You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reflex_ui/components/base/select.pyi
+44-18Lines changed: 44 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -94,15 +94,21 @@ class SelectRoot(SelectBaseComponent):
94
94
cls,
95
95
*children,
96
96
name: Var[str] |str|None=None,
97
-
default_value: Var[str]|str|None=None,
98
-
value: Var[str]|str|None=None,
97
+
default_value: Any|Var[Any]|None=None,
98
+
value: Any|Var[Any]|None=None,
99
99
default_open: Var[bool] |bool|None=None,
100
100
open: Var[bool] |bool|None=None,
101
+
actions_ref: Var[str] |str|None=None,
102
+
is_item_equal_to_value: Any|Var[Any] |None=None,
103
+
item_to_string_label: Any|Var[Any] |None=None,
104
+
item_to_string_value: Any|Var[Any] |None=None,
105
+
items: Any|Var[Any] |None=None,
101
106
modal: Var[bool] |bool|None=None,
102
107
multiple: Var[bool] |bool|None=None,
103
108
disabled: Var[bool] |bool|None=None,
104
109
read_only: Var[bool] |bool|None=None,
105
110
required: Var[bool] |bool|None=None,
111
+
input_ref: Any|Var[Any] |None=None,
106
112
unstyled: Var[bool] |bool|None=None,
107
113
style: Sequence[Mapping[str, Any]]
108
114
|Mapping[str, Any]
@@ -799,15 +805,20 @@ class HighLevelSelect(SelectRoot):
799
805
|Var[Literal["lg", "md", "sm", "xl", "xs"]]
800
806
|None=None,
801
807
name: Var[str] |str|None=None,
802
-
default_value: Var[str]|str|None=None,
803
-
value: Var[str]|str|None=None,
808
+
default_value: Any|Var[Any]|None=None,
809
+
value: Any|Var[Any]|None=None,
804
810
default_open: Var[bool] |bool|None=None,
805
811
open: Var[bool] |bool|None=None,
812
+
actions_ref: Var[str] |str|None=None,
813
+
is_item_equal_to_value: Any|Var[Any] |None=None,
814
+
item_to_string_label: Any|Var[Any] |None=None,
815
+
item_to_string_value: Any|Var[Any] |None=None,
806
816
modal: Var[bool] |bool|None=None,
807
817
multiple: Var[bool] |bool|None=None,
808
818
disabled: Var[bool] |bool|None=None,
809
819
read_only: Var[bool] |bool|None=None,
810
820
required: Var[bool] |bool|None=None,
821
+
input_ref: Any|Var[Any] |None=None,
811
822
unstyled: Var[bool] |bool|None=None,
812
823
style: Sequence[Mapping[str, Any]]
813
824
|Mapping[str, Any]
@@ -844,22 +855,27 @@ class HighLevelSelect(SelectRoot):
844
855
845
856
Args:
846
857
*children: Additional children to include in the select.
847
-
items: The list of items to display in the select dropdown
858
+
items: Data structure of the items rendered in the select popup. When specified, `<Select.Value>` renders the label of the selected item instead of the raw value.
848
859
placeholder: The placeholder text to display when no item is selected
849
860
size: The size of the select component. Defaults to "md".
850
861
name: Identifies the field when a form is submitted.
851
862
default_value: The uncontrolled value of the select when it's initially rendered. To render a controlled select, use the `value` prop instead.
852
863
value: The value of the select
853
864
on_value_change: Callback fired when the value of the select changes. Use when controlled.
854
-
default_open: Whether the select menu is initially open. To render a controlled select menu, use the `open` prop instead.
855
-
open: Whether the select menu is currently open
856
-
on_open_change: Event handler called when the select menu is opened or closed
857
-
on_open_change_complete: Event handler called after any animations complete when the select menu is opened or closed
865
+
default_open: Whether the select popup is initially open. To render a controlled select popup, use the `open` prop instead.
866
+
open: Whether the select popup is currently open
867
+
on_open_change: Event handler called when the select popup is opened or closed
868
+
actions_ref: A ref to imperative actions. When specified, the select will not be unmounted when closed. Instead, the `unmount` function must be called to unmount the select manually. Useful when the select's animation is controlled by an external library.
869
+
is_item_equal_to_value: Custom comparison logic used to determine if a select item value matches the current selected value. Useful when item values are objects without matching referentially. Defaults to `Object.is` comparison.
870
+
item_to_string_label: When the item values are objects, this function converts the object value to a string representation for display in the trigger. If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
871
+
item_to_string_value: When the item values are objects, this function converts the object value to a string representation for form submission. If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
858
872
modal: Determines if the select enters a modal state when open. - True: user interaction is limited to the select: document page scroll is locked and pointer interactions on outside elements are disabled. - False: user interaction with the rest of the document is allowed. Defaults to True.
859
873
multiple: Whether multiple items can be selected. Defaults to False.
874
+
on_open_change_complete: Event handler called after any animations complete when the select popup is opened or closed
860
875
disabled: Whether the component should ignore user interaction. Defaults to False.
861
-
read_only: Whether the user should be unable to choose a different option from the select menu. Defaults to False.
876
+
read_only: Whether the user should be unable to choose a different option from the select popup. Defaults to False.
862
877
required: Whether the user must choose a value before submitting a form. Defaults to False.
878
+
input_ref: A ref to access the hidden input element.
863
879
unstyled: Whether the component should be unstyled
864
880
style: The style of the component.
865
881
key: A unique key for the component.
@@ -902,15 +918,20 @@ class Select(ComponentNamespace):
902
918
|Var[Literal["lg", "md", "sm", "xl", "xs"]]
903
919
|None=None,
904
920
name: Var[str] |str|None=None,
905
-
default_value: Var[str]|str|None=None,
906
-
value: Var[str]|str|None=None,
921
+
default_value: Any|Var[Any]|None=None,
922
+
value: Any|Var[Any]|None=None,
907
923
default_open: Var[bool] |bool|None=None,
908
924
open: Var[bool] |bool|None=None,
925
+
actions_ref: Var[str] |str|None=None,
926
+
is_item_equal_to_value: Any|Var[Any] |None=None,
927
+
item_to_string_label: Any|Var[Any] |None=None,
928
+
item_to_string_value: Any|Var[Any] |None=None,
909
929
modal: Var[bool] |bool|None=None,
910
930
multiple: Var[bool] |bool|None=None,
911
931
disabled: Var[bool] |bool|None=None,
912
932
read_only: Var[bool] |bool|None=None,
913
933
required: Var[bool] |bool|None=None,
934
+
input_ref: Any|Var[Any] |None=None,
914
935
unstyled: Var[bool] |bool|None=None,
915
936
style: Sequence[Mapping[str, Any]]
916
937
|Mapping[str, Any]
@@ -947,22 +968,27 @@ class Select(ComponentNamespace):
947
968
948
969
Args:
949
970
*children: Additional children to include in the select.
950
-
items: The list of items to display in the select dropdown
971
+
items: Data structure of the items rendered in the select popup. When specified, `<Select.Value>` renders the label of the selected item instead of the raw value.
951
972
placeholder: The placeholder text to display when no item is selected
952
973
size: The size of the select component. Defaults to "md".
953
974
name: Identifies the field when a form is submitted.
954
975
default_value: The uncontrolled value of the select when it's initially rendered. To render a controlled select, use the `value` prop instead.
955
976
value: The value of the select
956
977
on_value_change: Callback fired when the value of the select changes. Use when controlled.
957
-
default_open: Whether the select menu is initially open. To render a controlled select menu, use the `open` prop instead.
958
-
open: Whether the select menu is currently open
959
-
on_open_change: Event handler called when the select menu is opened or closed
960
-
on_open_change_complete: Event handler called after any animations complete when the select menu is opened or closed
978
+
default_open: Whether the select popup is initially open. To render a controlled select popup, use the `open` prop instead.
979
+
open: Whether the select popup is currently open
980
+
on_open_change: Event handler called when the select popup is opened or closed
981
+
actions_ref: A ref to imperative actions. When specified, the select will not be unmounted when closed. Instead, the `unmount` function must be called to unmount the select manually. Useful when the select's animation is controlled by an external library.
982
+
is_item_equal_to_value: Custom comparison logic used to determine if a select item value matches the current selected value. Useful when item values are objects without matching referentially. Defaults to `Object.is` comparison.
983
+
item_to_string_label: When the item values are objects, this function converts the object value to a string representation for display in the trigger. If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
984
+
item_to_string_value: When the item values are objects, this function converts the object value to a string representation for form submission. If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
961
985
modal: Determines if the select enters a modal state when open. - True: user interaction is limited to the select: document page scroll is locked and pointer interactions on outside elements are disabled. - False: user interaction with the rest of the document is allowed. Defaults to True.
962
986
multiple: Whether multiple items can be selected. Defaults to False.
987
+
on_open_change_complete: Event handler called after any animations complete when the select popup is opened or closed
963
988
disabled: Whether the component should ignore user interaction. Defaults to False.
964
-
read_only: Whether the user should be unable to choose a different option from the select menu. Defaults to False.
989
+
read_only: Whether the user should be unable to choose a different option from the select popup. Defaults to False.
965
990
required: Whether the user must choose a value before submitting a form. Defaults to False.
991
+
input_ref: A ref to access the hidden input element.
966
992
unstyled: Whether the component should be unstyled
0 commit comments