switch.pyi 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. """Stub file for reflex/components/chakra/forms/switch.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.vars import Var, BaseVar, ComputedVar
  7. from reflex.event import EventChain, EventHandler, EventSpec
  8. from reflex.style import Style
  9. from typing import Any, Union
  10. from reflex.components.chakra import ChakraComponent, LiteralColorScheme
  11. from reflex.constants import EventTriggers
  12. from reflex.vars import Var
  13. class Switch(ChakraComponent):
  14. def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
  15. @overload
  16. @classmethod
  17. def create( # type: ignore
  18. cls,
  19. *children,
  20. is_checked: Optional[Union[Var[bool], bool]] = None,
  21. is_disabled: Optional[Union[Var[bool], bool]] = None,
  22. is_focusable: Optional[Union[Var[bool], bool]] = None,
  23. is_invalid: Optional[Union[Var[bool], bool]] = None,
  24. is_read_only: Optional[Union[Var[bool], bool]] = None,
  25. is_required: Optional[Union[Var[bool], bool]] = None,
  26. name: Optional[Union[Var[str], str]] = None,
  27. value: Optional[Union[Var[str], str]] = None,
  28. spacing: Optional[Union[Var[str], str]] = None,
  29. placeholder: Optional[Union[Var[str], str]] = None,
  30. color_scheme: Optional[
  31. Union[
  32. Var[
  33. Literal[
  34. "none",
  35. "gray",
  36. "red",
  37. "orange",
  38. "yellow",
  39. "green",
  40. "teal",
  41. "blue",
  42. "cyan",
  43. "purple",
  44. "pink",
  45. "whiteAlpha",
  46. "blackAlpha",
  47. "linkedin",
  48. "facebook",
  49. "messenger",
  50. "whatsapp",
  51. "twitter",
  52. "telegram",
  53. ]
  54. ],
  55. Literal[
  56. "none",
  57. "gray",
  58. "red",
  59. "orange",
  60. "yellow",
  61. "green",
  62. "teal",
  63. "blue",
  64. "cyan",
  65. "purple",
  66. "pink",
  67. "whiteAlpha",
  68. "blackAlpha",
  69. "linkedin",
  70. "facebook",
  71. "messenger",
  72. "whatsapp",
  73. "twitter",
  74. "telegram",
  75. ],
  76. ]
  77. ] = None,
  78. style: Optional[Style] = None,
  79. key: Optional[Any] = None,
  80. id: Optional[Any] = None,
  81. class_name: Optional[Any] = None,
  82. autofocus: Optional[bool] = None,
  83. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  84. on_blur: Optional[
  85. Union[EventHandler, EventSpec, list, function, BaseVar]
  86. ] = None,
  87. on_change: Optional[
  88. Union[EventHandler, EventSpec, list, function, BaseVar]
  89. ] = None,
  90. on_click: Optional[
  91. Union[EventHandler, EventSpec, list, function, BaseVar]
  92. ] = None,
  93. on_context_menu: Optional[
  94. Union[EventHandler, EventSpec, list, function, BaseVar]
  95. ] = None,
  96. on_double_click: Optional[
  97. Union[EventHandler, EventSpec, list, function, BaseVar]
  98. ] = None,
  99. on_focus: Optional[
  100. Union[EventHandler, EventSpec, list, function, BaseVar]
  101. ] = None,
  102. on_mount: Optional[
  103. Union[EventHandler, EventSpec, list, function, BaseVar]
  104. ] = None,
  105. on_mouse_down: Optional[
  106. Union[EventHandler, EventSpec, list, function, BaseVar]
  107. ] = None,
  108. on_mouse_enter: Optional[
  109. Union[EventHandler, EventSpec, list, function, BaseVar]
  110. ] = None,
  111. on_mouse_leave: Optional[
  112. Union[EventHandler, EventSpec, list, function, BaseVar]
  113. ] = None,
  114. on_mouse_move: Optional[
  115. Union[EventHandler, EventSpec, list, function, BaseVar]
  116. ] = None,
  117. on_mouse_out: Optional[
  118. Union[EventHandler, EventSpec, list, function, BaseVar]
  119. ] = None,
  120. on_mouse_over: Optional[
  121. Union[EventHandler, EventSpec, list, function, BaseVar]
  122. ] = None,
  123. on_mouse_up: Optional[
  124. Union[EventHandler, EventSpec, list, function, BaseVar]
  125. ] = None,
  126. on_scroll: Optional[
  127. Union[EventHandler, EventSpec, list, function, BaseVar]
  128. ] = None,
  129. on_unmount: Optional[
  130. Union[EventHandler, EventSpec, list, function, BaseVar]
  131. ] = None,
  132. **props
  133. ) -> "Switch":
  134. """Create the component.
  135. Args:
  136. *children: The children of the component.
  137. is_checked: If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled)
  138. is_disabled: If true, the switch will be disabled
  139. is_focusable: If true and is_disabled prop is set, the switch will remain tabbable but not interactive.
  140. is_invalid: If true, the switch is marked as invalid. Changes style of unchecked state.
  141. is_read_only: If true, the switch will be readonly
  142. is_required: If true, the switch will be required
  143. name: The name of the input field in a switch (Useful for form submission).
  144. value: The value of the input field when checked (use is_checked prop for a bool)
  145. spacing: The spacing between the switch and its label text (0.5rem)
  146. placeholder: The placeholder text.
  147. color_scheme: The color scheme of the switch (e.g. "blue", "green", "red", etc.)
  148. style: The style of the component.
  149. key: A unique key for the component.
  150. id: The id for the component.
  151. class_name: The class name for the component.
  152. autofocus: Whether the component should take the focus once the page is loaded
  153. custom_attrs: custom attribute
  154. **props: The props of the component.
  155. Returns:
  156. The component.
  157. """
  158. ...