icon_button.pyi 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. """Stub file for reflex/components/radix/themes/components/icon_button.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Callable, Dict, Literal, Optional, Union, overload
  6. from reflex.components.core.breakpoints import Breakpoints
  7. from reflex.components.el import elements
  8. from reflex.event import EventHandler, EventSpec
  9. from reflex.ivars.base import ImmutableVar
  10. from reflex.style import Style
  11. from reflex.vars import Var
  12. from ..base import (
  13. RadixLoadingProp,
  14. RadixThemesComponent,
  15. )
  16. LiteralButtonSize = Literal["1", "2", "3", "4"]
  17. class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent):
  18. @overload
  19. @classmethod
  20. def create( # type: ignore
  21. cls,
  22. *children,
  23. as_child: Optional[Union[Var[bool], bool]] = None,
  24. size: Optional[
  25. Union[
  26. Var[
  27. Union[
  28. Breakpoints[str, Literal["1", "2", "3", "4"]],
  29. Literal["1", "2", "3", "4"],
  30. ]
  31. ],
  32. Literal["1", "2", "3", "4"],
  33. Breakpoints[str, Literal["1", "2", "3", "4"]],
  34. ]
  35. ] = None,
  36. variant: Optional[
  37. Union[
  38. Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]],
  39. Literal["classic", "solid", "soft", "surface", "outline", "ghost"],
  40. ]
  41. ] = None,
  42. color_scheme: Optional[
  43. Union[
  44. Var[
  45. Literal[
  46. "tomato",
  47. "red",
  48. "ruby",
  49. "crimson",
  50. "pink",
  51. "plum",
  52. "purple",
  53. "violet",
  54. "iris",
  55. "indigo",
  56. "blue",
  57. "cyan",
  58. "teal",
  59. "jade",
  60. "green",
  61. "grass",
  62. "brown",
  63. "orange",
  64. "sky",
  65. "mint",
  66. "lime",
  67. "yellow",
  68. "amber",
  69. "gold",
  70. "bronze",
  71. "gray",
  72. ]
  73. ],
  74. Literal[
  75. "tomato",
  76. "red",
  77. "ruby",
  78. "crimson",
  79. "pink",
  80. "plum",
  81. "purple",
  82. "violet",
  83. "iris",
  84. "indigo",
  85. "blue",
  86. "cyan",
  87. "teal",
  88. "jade",
  89. "green",
  90. "grass",
  91. "brown",
  92. "orange",
  93. "sky",
  94. "mint",
  95. "lime",
  96. "yellow",
  97. "amber",
  98. "gold",
  99. "bronze",
  100. "gray",
  101. ],
  102. ]
  103. ] = None,
  104. high_contrast: Optional[Union[Var[bool], bool]] = None,
  105. radius: Optional[
  106. Union[
  107. Var[Literal["none", "small", "medium", "large", "full"]],
  108. Literal["none", "small", "medium", "large", "full"],
  109. ]
  110. ] = None,
  111. auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  112. disabled: Optional[Union[Var[bool], bool]] = None,
  113. form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  114. form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  115. form_enc_type: Optional[
  116. Union[Var[Union[bool, int, str]], str, int, bool]
  117. ] = None,
  118. form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  119. form_no_validate: Optional[
  120. Union[Var[Union[bool, int, str]], str, int, bool]
  121. ] = None,
  122. form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  123. name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  124. type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  125. value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  126. access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  127. auto_capitalize: Optional[
  128. Union[Var[Union[bool, int, str]], str, int, bool]
  129. ] = None,
  130. content_editable: Optional[
  131. Union[Var[Union[bool, int, str]], str, int, bool]
  132. ] = None,
  133. context_menu: Optional[
  134. Union[Var[Union[bool, int, str]], str, int, bool]
  135. ] = None,
  136. dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  137. draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  138. enter_key_hint: Optional[
  139. Union[Var[Union[bool, int, str]], str, int, bool]
  140. ] = None,
  141. hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  142. input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  143. item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  144. lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  145. role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  146. slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  147. spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  148. tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  149. title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  150. loading: Optional[Union[Var[bool], bool]] = None,
  151. style: Optional[Style] = None,
  152. key: Optional[Any] = None,
  153. id: Optional[Any] = None,
  154. class_name: Optional[Any] = None,
  155. autofocus: Optional[bool] = None,
  156. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  157. on_blur: Optional[
  158. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  159. ] = None,
  160. on_click: Optional[
  161. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  162. ] = None,
  163. on_context_menu: Optional[
  164. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  165. ] = None,
  166. on_double_click: Optional[
  167. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  168. ] = None,
  169. on_focus: Optional[
  170. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  171. ] = None,
  172. on_mount: Optional[
  173. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  174. ] = None,
  175. on_mouse_down: Optional[
  176. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  177. ] = None,
  178. on_mouse_enter: Optional[
  179. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  180. ] = None,
  181. on_mouse_leave: Optional[
  182. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  183. ] = None,
  184. on_mouse_move: Optional[
  185. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  186. ] = None,
  187. on_mouse_out: Optional[
  188. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  189. ] = None,
  190. on_mouse_over: Optional[
  191. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  192. ] = None,
  193. on_mouse_up: Optional[
  194. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  195. ] = None,
  196. on_scroll: Optional[
  197. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  198. ] = None,
  199. on_unmount: Optional[
  200. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  201. ] = None,
  202. **props,
  203. ) -> "IconButton":
  204. """Create a IconButton component.
  205. Args:
  206. *children: The children of the component.
  207. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  208. size: Button size "1" - "4"
  209. variant: Variant of button: "classic" | "solid" | "soft" | "surface" | "outline" | "ghost"
  210. color_scheme: Override theme color for button
  211. high_contrast: Whether to render the button with higher contrast color against background
  212. radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
  213. auto_focus: Automatically focuses the button when the page loads
  214. disabled: Disables the button
  215. form: Associates the button with a form (by id)
  216. form_action: URL to send the form data to (for type="submit" buttons)
  217. form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons)
  218. form_method: HTTP method to use for sending form data (for type="submit" buttons)
  219. form_no_validate: Bypasses form validation when submitting (for type="submit" buttons)
  220. form_target: Specifies where to display the response after submitting the form (for type="submit" buttons)
  221. name: Name of the button, used when sending form data
  222. type: Type of the button (submit, reset, or button)
  223. value: Value of the button, used when sending form data
  224. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  225. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  226. content_editable: Indicates whether the element's content is editable.
  227. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  228. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  229. draggable: Defines whether the element can be dragged.
  230. enter_key_hint: Hints what media types the media element is able to play.
  231. hidden: Defines whether the element is hidden.
  232. input_mode: Defines the type of the element.
  233. item_prop: Defines the name of the element for metadata purposes.
  234. lang: Defines the language used in the element.
  235. role: Defines the role of the element.
  236. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  237. spell_check: Defines whether the element may be checked for spelling errors.
  238. tab_index: Defines the position of the current element in the tabbing order.
  239. title: Defines a tooltip for the element.
  240. loading: If set, show an rx.spinner instead of the component children.
  241. style: The style of the component.
  242. key: A unique key for the component.
  243. id: The id for the component.
  244. class_name: The class name for the component.
  245. autofocus: Whether the component should take the focus once the page is loaded
  246. custom_attrs: custom attribute
  247. **props: The properties of the component.
  248. Raises:
  249. ValueError: If no children are passed.
  250. Returns:
  251. The IconButton component.
  252. """
  253. ...
  254. def add_style(self): ...
  255. icon_button = IconButton.create