context_menu.pyi 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. """Stub file for reflex/components/radix/themes/components/context_menu.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Literal, Optional, Sequence, overload
  6. from reflex.components.component import ComponentNamespace
  7. from reflex.components.core.breakpoints import Breakpoints
  8. from reflex.event import EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. from ..base import RadixThemesComponent
  12. from .checkbox import Checkbox
  13. from .radio_group import HighLevelRadioGroup
  14. LiteralDirType = Literal["ltr", "rtl"]
  15. LiteralSizeType = Literal["1", "2"]
  16. LiteralVariantType = Literal["solid", "soft"]
  17. LiteralSideType = Literal["top", "right", "bottom", "left"]
  18. LiteralAlignType = Literal["start", "center", "end"]
  19. LiteralStickyType = Literal["partial", "always"]
  20. class ContextMenuRoot(RadixThemesComponent):
  21. @overload
  22. @classmethod
  23. def create( # type: ignore
  24. cls,
  25. *children,
  26. modal: Var[bool] | bool | None = None,
  27. dir: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None,
  28. style: Style | None = None,
  29. key: Any | None = None,
  30. id: Any | None = None,
  31. class_name: Any | None = None,
  32. autofocus: bool | None = None,
  33. custom_attrs: dict[str, Var | Any] | None = None,
  34. on_blur: Optional[EventType[()]] = None,
  35. on_click: Optional[EventType[()]] = None,
  36. on_context_menu: Optional[EventType[()]] = None,
  37. on_double_click: Optional[EventType[()]] = None,
  38. on_focus: Optional[EventType[()]] = None,
  39. on_mount: Optional[EventType[()]] = None,
  40. on_mouse_down: Optional[EventType[()]] = None,
  41. on_mouse_enter: Optional[EventType[()]] = None,
  42. on_mouse_leave: Optional[EventType[()]] = None,
  43. on_mouse_move: Optional[EventType[()]] = None,
  44. on_mouse_out: Optional[EventType[()]] = None,
  45. on_mouse_over: Optional[EventType[()]] = None,
  46. on_mouse_up: Optional[EventType[()]] = None,
  47. on_open_change: Optional[EventType[()] | EventType[bool]] = None,
  48. on_scroll: Optional[EventType[()]] = None,
  49. on_unmount: Optional[EventType[()]] = None,
  50. **props,
  51. ) -> "ContextMenuRoot":
  52. """Create a new component instance.
  53. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  54. other UI libraries for common names, like Text and Button.
  55. Args:
  56. *children: Child components.
  57. modal: The modality of the context menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
  58. on_open_change: Fired when the open state changes.
  59. dir: The reading direction of submenus when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
  60. style: The style of the component.
  61. key: A unique key for the component.
  62. id: The id for the component.
  63. class_name: The class name for the component.
  64. autofocus: Whether the component should take the focus once the page is loaded
  65. custom_attrs: custom attribute
  66. **props: Component properties.
  67. Returns:
  68. A new component instance.
  69. """
  70. ...
  71. class ContextMenuTrigger(RadixThemesComponent):
  72. @overload
  73. @classmethod
  74. def create( # type: ignore
  75. cls,
  76. *children,
  77. disabled: Var[bool] | bool | None = None,
  78. style: Style | None = None,
  79. key: Any | None = None,
  80. id: Any | None = None,
  81. class_name: Any | None = None,
  82. autofocus: bool | None = None,
  83. custom_attrs: dict[str, Var | Any] | None = None,
  84. on_blur: Optional[EventType[()]] = None,
  85. on_click: Optional[EventType[()]] = None,
  86. on_context_menu: Optional[EventType[()]] = None,
  87. on_double_click: Optional[EventType[()]] = None,
  88. on_focus: Optional[EventType[()]] = None,
  89. on_mount: Optional[EventType[()]] = None,
  90. on_mouse_down: Optional[EventType[()]] = None,
  91. on_mouse_enter: Optional[EventType[()]] = None,
  92. on_mouse_leave: Optional[EventType[()]] = None,
  93. on_mouse_move: Optional[EventType[()]] = None,
  94. on_mouse_out: Optional[EventType[()]] = None,
  95. on_mouse_over: Optional[EventType[()]] = None,
  96. on_mouse_up: Optional[EventType[()]] = None,
  97. on_scroll: Optional[EventType[()]] = None,
  98. on_unmount: Optional[EventType[()]] = None,
  99. **props,
  100. ) -> "ContextMenuTrigger":
  101. """Create a new component instance.
  102. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  103. other UI libraries for common names, like Text and Button.
  104. Args:
  105. *children: Child components.
  106. disabled: Whether the trigger is disabled
  107. style: The style of the component.
  108. key: A unique key for the component.
  109. id: The id for the component.
  110. class_name: The class name for the component.
  111. autofocus: Whether the component should take the focus once the page is loaded
  112. custom_attrs: custom attribute
  113. **props: Component properties.
  114. Returns:
  115. A new component instance.
  116. """
  117. ...
  118. class ContextMenuContent(RadixThemesComponent):
  119. @overload
  120. @classmethod
  121. def create( # type: ignore
  122. cls,
  123. *children,
  124. size: Breakpoints[str, Literal["1", "2"]]
  125. | Literal["1", "2"]
  126. | Var[Breakpoints[str, Literal["1", "2"]] | Literal["1", "2"]]
  127. | None = None,
  128. variant: Literal["soft", "solid"] | Var[Literal["soft", "solid"]] | None = None,
  129. color_scheme: Literal[
  130. "amber",
  131. "blue",
  132. "bronze",
  133. "brown",
  134. "crimson",
  135. "cyan",
  136. "gold",
  137. "grass",
  138. "gray",
  139. "green",
  140. "indigo",
  141. "iris",
  142. "jade",
  143. "lime",
  144. "mint",
  145. "orange",
  146. "pink",
  147. "plum",
  148. "purple",
  149. "red",
  150. "ruby",
  151. "sky",
  152. "teal",
  153. "tomato",
  154. "violet",
  155. "yellow",
  156. ]
  157. | Var[
  158. Literal[
  159. "amber",
  160. "blue",
  161. "bronze",
  162. "brown",
  163. "crimson",
  164. "cyan",
  165. "gold",
  166. "grass",
  167. "gray",
  168. "green",
  169. "indigo",
  170. "iris",
  171. "jade",
  172. "lime",
  173. "mint",
  174. "orange",
  175. "pink",
  176. "plum",
  177. "purple",
  178. "red",
  179. "ruby",
  180. "sky",
  181. "teal",
  182. "tomato",
  183. "violet",
  184. "yellow",
  185. ]
  186. ]
  187. | None = None,
  188. high_contrast: Var[bool] | bool | None = None,
  189. as_child: Var[bool] | bool | None = None,
  190. loop: Var[bool] | bool | None = None,
  191. force_mount: Var[bool] | bool | None = None,
  192. side: Literal["bottom", "left", "right", "top"]
  193. | Var[Literal["bottom", "left", "right", "top"]]
  194. | None = None,
  195. side_offset: Var[float | int] | float | int | None = None,
  196. align: Literal["center", "end", "start"]
  197. | Var[Literal["center", "end", "start"]]
  198. | None = None,
  199. align_offset: Var[float | int] | float | int | None = None,
  200. avoid_collisions: Var[bool] | bool | None = None,
  201. collision_padding: Var[dict[str, float | int] | float | int]
  202. | dict[str, float | int]
  203. | float
  204. | int
  205. | None = None,
  206. sticky: Literal["always", "partial"]
  207. | Var[Literal["always", "partial"]]
  208. | None = None,
  209. hide_when_detached: Var[bool] | bool | None = None,
  210. style: Style | None = None,
  211. key: Any | None = None,
  212. id: Any | None = None,
  213. class_name: Any | None = None,
  214. autofocus: bool | None = None,
  215. custom_attrs: dict[str, Var | Any] | None = None,
  216. on_blur: Optional[EventType[()]] = None,
  217. on_click: Optional[EventType[()]] = None,
  218. on_close_auto_focus: Optional[EventType[()]] = None,
  219. on_context_menu: Optional[EventType[()]] = None,
  220. on_double_click: Optional[EventType[()]] = None,
  221. on_escape_key_down: Optional[EventType[()]] = None,
  222. on_focus: Optional[EventType[()]] = None,
  223. on_focus_outside: Optional[EventType[()]] = None,
  224. on_interact_outside: Optional[EventType[()]] = None,
  225. on_mount: Optional[EventType[()]] = None,
  226. on_mouse_down: Optional[EventType[()]] = None,
  227. on_mouse_enter: Optional[EventType[()]] = None,
  228. on_mouse_leave: Optional[EventType[()]] = None,
  229. on_mouse_move: Optional[EventType[()]] = None,
  230. on_mouse_out: Optional[EventType[()]] = None,
  231. on_mouse_over: Optional[EventType[()]] = None,
  232. on_mouse_up: Optional[EventType[()]] = None,
  233. on_pointer_down_outside: Optional[EventType[()]] = None,
  234. on_scroll: Optional[EventType[()]] = None,
  235. on_unmount: Optional[EventType[()]] = None,
  236. **props,
  237. ) -> "ContextMenuContent":
  238. """Create a new component instance.
  239. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  240. other UI libraries for common names, like Text and Button.
  241. Args:
  242. *children: Child components.
  243. size: Dropdown Menu Content size "1" - "2"
  244. variant: Variant of Dropdown Menu Content: "solid" | "soft"
  245. color_scheme: Override theme color for Dropdown Menu Content
  246. high_contrast: Renders the Dropdown Menu Content in higher contrast
  247. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  248. loop: When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
  249. force_mount: Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
  250. side: The preferred side of the trigger to render against when open. Will be reversed when collisions occur and `avoid_collisions` is enabled.The position of the tooltip. Defaults to "top".
  251. side_offset: The distance in pixels from the trigger. Defaults to 0.
  252. align: The preferred alignment against the trigger. May change when collisions occur. Defaults to "center".
  253. align_offset: An offset in pixels from the "start" or "end" alignment options.
  254. avoid_collisions: When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
  255. collision_padding: The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { "top": 20, "left": 20 }. Defaults to 0.
  256. sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. Defaults to "partial".
  257. hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
  258. on_close_auto_focus: Fired when focus moves back after closing.
  259. on_escape_key_down: Fired when the escape key is pressed.
  260. on_pointer_down_outside: Fired when a pointer down event happens outside the context menu.
  261. on_focus_outside: Fired when focus moves outside the context menu.
  262. on_interact_outside: Fired when the pointer interacts outside the context menu.
  263. style: The style of the component.
  264. key: A unique key for the component.
  265. id: The id for the component.
  266. class_name: The class name for the component.
  267. autofocus: Whether the component should take the focus once the page is loaded
  268. custom_attrs: custom attribute
  269. **props: Component properties.
  270. Returns:
  271. A new component instance.
  272. """
  273. ...
  274. class ContextMenuSub(RadixThemesComponent):
  275. @overload
  276. @classmethod
  277. def create( # type: ignore
  278. cls,
  279. *children,
  280. open: Var[bool] | bool | None = None,
  281. default_open: Var[bool] | bool | None = None,
  282. style: Style | None = None,
  283. key: Any | None = None,
  284. id: Any | None = None,
  285. class_name: Any | None = None,
  286. autofocus: bool | None = None,
  287. custom_attrs: dict[str, Var | Any] | None = None,
  288. on_blur: Optional[EventType[()]] = None,
  289. on_click: Optional[EventType[()]] = None,
  290. on_context_menu: Optional[EventType[()]] = None,
  291. on_double_click: Optional[EventType[()]] = None,
  292. on_focus: Optional[EventType[()]] = None,
  293. on_mount: Optional[EventType[()]] = None,
  294. on_mouse_down: Optional[EventType[()]] = None,
  295. on_mouse_enter: Optional[EventType[()]] = None,
  296. on_mouse_leave: Optional[EventType[()]] = None,
  297. on_mouse_move: Optional[EventType[()]] = None,
  298. on_mouse_out: Optional[EventType[()]] = None,
  299. on_mouse_over: Optional[EventType[()]] = None,
  300. on_mouse_up: Optional[EventType[()]] = None,
  301. on_open_change: Optional[EventType[()] | EventType[bool]] = None,
  302. on_scroll: Optional[EventType[()]] = None,
  303. on_unmount: Optional[EventType[()]] = None,
  304. **props,
  305. ) -> "ContextMenuSub":
  306. """Create a new component instance.
  307. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  308. other UI libraries for common names, like Text and Button.
  309. Args:
  310. *children: Child components.
  311. open: The controlled open state of the submenu. Must be used in conjunction with `on_open_change`.
  312. default_open: The open state of the submenu when it is initially rendered. Use when you do not need to control its open state.
  313. on_open_change: Fired when the open state changes.
  314. style: The style of the component.
  315. key: A unique key for the component.
  316. id: The id for the component.
  317. class_name: The class name for the component.
  318. autofocus: Whether the component should take the focus once the page is loaded
  319. custom_attrs: custom attribute
  320. **props: Component properties.
  321. Returns:
  322. A new component instance.
  323. """
  324. ...
  325. class ContextMenuSubTrigger(RadixThemesComponent):
  326. @overload
  327. @classmethod
  328. def create( # type: ignore
  329. cls,
  330. *children,
  331. as_child: Var[bool] | bool | None = None,
  332. disabled: Var[bool] | bool | None = None,
  333. text_value: Var[str] | str | None = None,
  334. style: Style | None = None,
  335. key: Any | None = None,
  336. id: Any | None = None,
  337. class_name: Any | None = None,
  338. autofocus: bool | None = None,
  339. custom_attrs: dict[str, Var | Any] | None = None,
  340. on_blur: Optional[EventType[()]] = None,
  341. on_click: Optional[EventType[()]] = None,
  342. on_context_menu: Optional[EventType[()]] = None,
  343. on_double_click: Optional[EventType[()]] = None,
  344. on_focus: Optional[EventType[()]] = None,
  345. on_mount: Optional[EventType[()]] = None,
  346. on_mouse_down: Optional[EventType[()]] = None,
  347. on_mouse_enter: Optional[EventType[()]] = None,
  348. on_mouse_leave: Optional[EventType[()]] = None,
  349. on_mouse_move: Optional[EventType[()]] = None,
  350. on_mouse_out: Optional[EventType[()]] = None,
  351. on_mouse_over: Optional[EventType[()]] = None,
  352. on_mouse_up: Optional[EventType[()]] = None,
  353. on_scroll: Optional[EventType[()]] = None,
  354. on_unmount: Optional[EventType[()]] = None,
  355. **props,
  356. ) -> "ContextMenuSubTrigger":
  357. """Create a new component instance.
  358. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  359. other UI libraries for common names, like Text and Button.
  360. Args:
  361. *children: Child components.
  362. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  363. disabled: Whether the trigger is disabled
  364. text_value: Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
  365. style: The style of the component.
  366. key: A unique key for the component.
  367. id: The id for the component.
  368. class_name: The class name for the component.
  369. autofocus: Whether the component should take the focus once the page is loaded
  370. custom_attrs: custom attribute
  371. **props: Component properties.
  372. Returns:
  373. A new component instance.
  374. """
  375. ...
  376. class ContextMenuSubContent(RadixThemesComponent):
  377. @overload
  378. @classmethod
  379. def create( # type: ignore
  380. cls,
  381. *children,
  382. as_child: Var[bool] | bool | None = None,
  383. loop: Var[bool] | bool | None = None,
  384. force_mount: Var[bool] | bool | None = None,
  385. side_offset: Var[float | int] | float | int | None = None,
  386. align_offset: Var[float | int] | float | int | None = None,
  387. avoid_collisions: Var[bool] | bool | None = None,
  388. collision_padding: Var[dict[str, float | int] | float | int]
  389. | dict[str, float | int]
  390. | float
  391. | int
  392. | None = None,
  393. sticky: Literal["always", "partial"]
  394. | Var[Literal["always", "partial"]]
  395. | None = None,
  396. hide_when_detached: Var[bool] | bool | None = None,
  397. style: Style | None = None,
  398. key: Any | None = None,
  399. id: Any | None = None,
  400. class_name: Any | None = None,
  401. autofocus: bool | None = None,
  402. custom_attrs: dict[str, Var | Any] | None = None,
  403. on_blur: Optional[EventType[()]] = None,
  404. on_click: Optional[EventType[()]] = None,
  405. on_context_menu: Optional[EventType[()]] = None,
  406. on_double_click: Optional[EventType[()]] = None,
  407. on_escape_key_down: Optional[EventType[()]] = None,
  408. on_focus: Optional[EventType[()]] = None,
  409. on_focus_outside: Optional[EventType[()]] = None,
  410. on_interact_outside: Optional[EventType[()]] = None,
  411. on_mount: Optional[EventType[()]] = None,
  412. on_mouse_down: Optional[EventType[()]] = None,
  413. on_mouse_enter: Optional[EventType[()]] = None,
  414. on_mouse_leave: Optional[EventType[()]] = None,
  415. on_mouse_move: Optional[EventType[()]] = None,
  416. on_mouse_out: Optional[EventType[()]] = None,
  417. on_mouse_over: Optional[EventType[()]] = None,
  418. on_mouse_up: Optional[EventType[()]] = None,
  419. on_pointer_down_outside: Optional[EventType[()]] = None,
  420. on_scroll: Optional[EventType[()]] = None,
  421. on_unmount: Optional[EventType[()]] = None,
  422. **props,
  423. ) -> "ContextMenuSubContent":
  424. """Create a new component instance.
  425. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  426. other UI libraries for common names, like Text and Button.
  427. Args:
  428. *children: Child components.
  429. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  430. loop: When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
  431. force_mount: Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
  432. side_offset: The distance in pixels from the trigger. Defaults to 0.
  433. align_offset: An offset in pixels from the "start" or "end" alignment options.
  434. avoid_collisions: When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
  435. collision_padding: The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { "top": 20, "left": 20 }. Defaults to 0.
  436. sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. Defaults to "partial".
  437. hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
  438. on_escape_key_down: Fired when the escape key is pressed.
  439. on_pointer_down_outside: Fired when a pointer down event happens outside the context menu.
  440. on_focus_outside: Fired when focus moves outside the context menu.
  441. on_interact_outside: Fired when interacting outside the context menu.
  442. style: The style of the component.
  443. key: A unique key for the component.
  444. id: The id for the component.
  445. class_name: The class name for the component.
  446. autofocus: Whether the component should take the focus once the page is loaded
  447. custom_attrs: custom attribute
  448. **props: Component properties.
  449. Returns:
  450. A new component instance.
  451. """
  452. ...
  453. class ContextMenuItem(RadixThemesComponent):
  454. @overload
  455. @classmethod
  456. def create( # type: ignore
  457. cls,
  458. *children,
  459. color_scheme: Literal[
  460. "amber",
  461. "blue",
  462. "bronze",
  463. "brown",
  464. "crimson",
  465. "cyan",
  466. "gold",
  467. "grass",
  468. "gray",
  469. "green",
  470. "indigo",
  471. "iris",
  472. "jade",
  473. "lime",
  474. "mint",
  475. "orange",
  476. "pink",
  477. "plum",
  478. "purple",
  479. "red",
  480. "ruby",
  481. "sky",
  482. "teal",
  483. "tomato",
  484. "violet",
  485. "yellow",
  486. ]
  487. | Var[
  488. Literal[
  489. "amber",
  490. "blue",
  491. "bronze",
  492. "brown",
  493. "crimson",
  494. "cyan",
  495. "gold",
  496. "grass",
  497. "gray",
  498. "green",
  499. "indigo",
  500. "iris",
  501. "jade",
  502. "lime",
  503. "mint",
  504. "orange",
  505. "pink",
  506. "plum",
  507. "purple",
  508. "red",
  509. "ruby",
  510. "sky",
  511. "teal",
  512. "tomato",
  513. "violet",
  514. "yellow",
  515. ]
  516. ]
  517. | None = None,
  518. shortcut: Var[str] | str | None = None,
  519. as_child: Var[bool] | bool | None = None,
  520. disabled: Var[bool] | bool | None = None,
  521. text_value: Var[str] | str | None = None,
  522. style: Style | None = None,
  523. key: Any | None = None,
  524. id: Any | None = None,
  525. class_name: Any | None = None,
  526. autofocus: bool | None = None,
  527. custom_attrs: dict[str, Var | Any] | None = None,
  528. on_blur: Optional[EventType[()]] = None,
  529. on_click: Optional[EventType[()]] = None,
  530. on_context_menu: Optional[EventType[()]] = None,
  531. on_double_click: Optional[EventType[()]] = None,
  532. on_focus: Optional[EventType[()]] = None,
  533. on_mount: Optional[EventType[()]] = None,
  534. on_mouse_down: Optional[EventType[()]] = None,
  535. on_mouse_enter: Optional[EventType[()]] = None,
  536. on_mouse_leave: Optional[EventType[()]] = None,
  537. on_mouse_move: Optional[EventType[()]] = None,
  538. on_mouse_out: Optional[EventType[()]] = None,
  539. on_mouse_over: Optional[EventType[()]] = None,
  540. on_mouse_up: Optional[EventType[()]] = None,
  541. on_scroll: Optional[EventType[()]] = None,
  542. on_select: Optional[EventType[()]] = None,
  543. on_unmount: Optional[EventType[()]] = None,
  544. **props,
  545. ) -> "ContextMenuItem":
  546. """Create a new component instance.
  547. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  548. other UI libraries for common names, like Text and Button.
  549. Args:
  550. *children: Child components.
  551. color_scheme: Override theme color for button
  552. shortcut: Shortcut to render a menu item as a link
  553. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  554. disabled: When true, prevents the user from interacting with the item.
  555. text_value: Optional text used for typeahead purposes. By default the typeahead behavior will use the content of the item. Use this when the content is complex, or you have non-textual content inside.
  556. on_select: Fired when the item is selected.
  557. style: The style of the component.
  558. key: A unique key for the component.
  559. id: The id for the component.
  560. class_name: The class name for the component.
  561. autofocus: Whether the component should take the focus once the page is loaded
  562. custom_attrs: custom attribute
  563. **props: Component properties.
  564. Returns:
  565. A new component instance.
  566. """
  567. ...
  568. class ContextMenuSeparator(RadixThemesComponent):
  569. @overload
  570. @classmethod
  571. def create( # type: ignore
  572. cls,
  573. *children,
  574. style: Style | None = None,
  575. key: Any | None = None,
  576. id: Any | None = None,
  577. class_name: Any | None = None,
  578. autofocus: bool | None = None,
  579. custom_attrs: dict[str, Var | Any] | None = None,
  580. on_blur: Optional[EventType[()]] = None,
  581. on_click: Optional[EventType[()]] = None,
  582. on_context_menu: Optional[EventType[()]] = None,
  583. on_double_click: Optional[EventType[()]] = None,
  584. on_focus: Optional[EventType[()]] = None,
  585. on_mount: Optional[EventType[()]] = None,
  586. on_mouse_down: Optional[EventType[()]] = None,
  587. on_mouse_enter: Optional[EventType[()]] = None,
  588. on_mouse_leave: Optional[EventType[()]] = None,
  589. on_mouse_move: Optional[EventType[()]] = None,
  590. on_mouse_out: Optional[EventType[()]] = None,
  591. on_mouse_over: Optional[EventType[()]] = None,
  592. on_mouse_up: Optional[EventType[()]] = None,
  593. on_scroll: Optional[EventType[()]] = None,
  594. on_unmount: Optional[EventType[()]] = None,
  595. **props,
  596. ) -> "ContextMenuSeparator":
  597. """Create a new component instance.
  598. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  599. other UI libraries for common names, like Text and Button.
  600. Args:
  601. *children: Child components.
  602. style: The style of the component.
  603. key: A unique key for the component.
  604. id: The id for the component.
  605. class_name: The class name for the component.
  606. autofocus: Whether the component should take the focus once the page is loaded
  607. custom_attrs: custom attribute
  608. **props: Component properties.
  609. Returns:
  610. A new component instance.
  611. """
  612. ...
  613. class ContextMenuCheckbox(Checkbox):
  614. @overload
  615. @classmethod
  616. def create( # type: ignore
  617. cls,
  618. *children,
  619. shortcut: Var[str] | str | None = None,
  620. as_child: Var[bool] | bool | None = None,
  621. size: Breakpoints[str, Literal["1", "2", "3"]]
  622. | Literal["1", "2", "3"]
  623. | Var[Breakpoints[str, Literal["1", "2", "3"]] | Literal["1", "2", "3"]]
  624. | None = None,
  625. variant: Literal["classic", "soft", "surface"]
  626. | Var[Literal["classic", "soft", "surface"]]
  627. | None = None,
  628. color_scheme: Literal[
  629. "amber",
  630. "blue",
  631. "bronze",
  632. "brown",
  633. "crimson",
  634. "cyan",
  635. "gold",
  636. "grass",
  637. "gray",
  638. "green",
  639. "indigo",
  640. "iris",
  641. "jade",
  642. "lime",
  643. "mint",
  644. "orange",
  645. "pink",
  646. "plum",
  647. "purple",
  648. "red",
  649. "ruby",
  650. "sky",
  651. "teal",
  652. "tomato",
  653. "violet",
  654. "yellow",
  655. ]
  656. | Var[
  657. Literal[
  658. "amber",
  659. "blue",
  660. "bronze",
  661. "brown",
  662. "crimson",
  663. "cyan",
  664. "gold",
  665. "grass",
  666. "gray",
  667. "green",
  668. "indigo",
  669. "iris",
  670. "jade",
  671. "lime",
  672. "mint",
  673. "orange",
  674. "pink",
  675. "plum",
  676. "purple",
  677. "red",
  678. "ruby",
  679. "sky",
  680. "teal",
  681. "tomato",
  682. "violet",
  683. "yellow",
  684. ]
  685. ]
  686. | None = None,
  687. high_contrast: Var[bool] | bool | None = None,
  688. default_checked: Var[bool] | bool | None = None,
  689. checked: Var[bool] | bool | None = None,
  690. disabled: Var[bool] | bool | None = None,
  691. required: Var[bool] | bool | None = None,
  692. name: Var[str] | str | None = None,
  693. value: Var[str] | str | None = None,
  694. style: Style | None = None,
  695. key: Any | None = None,
  696. id: Any | None = None,
  697. class_name: Any | None = None,
  698. autofocus: bool | None = None,
  699. custom_attrs: dict[str, Var | Any] | None = None,
  700. on_blur: Optional[EventType[()]] = None,
  701. on_change: Optional[EventType[()] | EventType[bool]] = None,
  702. on_click: Optional[EventType[()]] = None,
  703. on_context_menu: Optional[EventType[()]] = None,
  704. on_double_click: Optional[EventType[()]] = None,
  705. on_focus: Optional[EventType[()]] = None,
  706. on_mount: Optional[EventType[()]] = None,
  707. on_mouse_down: Optional[EventType[()]] = None,
  708. on_mouse_enter: Optional[EventType[()]] = None,
  709. on_mouse_leave: Optional[EventType[()]] = None,
  710. on_mouse_move: Optional[EventType[()]] = None,
  711. on_mouse_out: Optional[EventType[()]] = None,
  712. on_mouse_over: Optional[EventType[()]] = None,
  713. on_mouse_up: Optional[EventType[()]] = None,
  714. on_scroll: Optional[EventType[()]] = None,
  715. on_unmount: Optional[EventType[()]] = None,
  716. **props,
  717. ) -> "ContextMenuCheckbox":
  718. """Create a new component instance.
  719. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  720. other UI libraries for common names, like Text and Button.
  721. Args:
  722. *children: Child components.
  723. shortcut: Text to render as shortcut.
  724. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  725. size: Checkbox size "1" - "3"
  726. variant: Variant of checkbox: "classic" | "surface" | "soft"
  727. color_scheme: Override theme color for checkbox
  728. high_contrast: Whether to render the checkbox with higher contrast color against background
  729. default_checked: Whether the checkbox is checked by default
  730. checked: Whether the checkbox is checked
  731. disabled: Whether the checkbox is disabled
  732. required: Whether the checkbox is required
  733. name: The name of the checkbox control when submitting the form.
  734. value: The value of the checkbox control when submitting the form.
  735. on_change: Fired when the checkbox is checked or unchecked.
  736. style: The style of the component.
  737. key: A unique key for the component.
  738. id: The id for the component.
  739. class_name: The class name for the component.
  740. autofocus: Whether the component should take the focus once the page is loaded
  741. custom_attrs: custom attribute
  742. **props: Component properties.
  743. Returns:
  744. A new component instance.
  745. """
  746. ...
  747. class ContextMenuLabel(RadixThemesComponent):
  748. @overload
  749. @classmethod
  750. def create( # type: ignore
  751. cls,
  752. *children,
  753. as_child: Var[bool] | bool | None = None,
  754. style: Style | None = None,
  755. key: Any | None = None,
  756. id: Any | None = None,
  757. class_name: Any | None = None,
  758. autofocus: bool | None = None,
  759. custom_attrs: dict[str, Var | Any] | None = None,
  760. on_blur: Optional[EventType[()]] = None,
  761. on_click: Optional[EventType[()]] = None,
  762. on_context_menu: Optional[EventType[()]] = None,
  763. on_double_click: Optional[EventType[()]] = None,
  764. on_focus: Optional[EventType[()]] = None,
  765. on_mount: Optional[EventType[()]] = None,
  766. on_mouse_down: Optional[EventType[()]] = None,
  767. on_mouse_enter: Optional[EventType[()]] = None,
  768. on_mouse_leave: Optional[EventType[()]] = None,
  769. on_mouse_move: Optional[EventType[()]] = None,
  770. on_mouse_out: Optional[EventType[()]] = None,
  771. on_mouse_over: Optional[EventType[()]] = None,
  772. on_mouse_up: Optional[EventType[()]] = None,
  773. on_scroll: Optional[EventType[()]] = None,
  774. on_unmount: Optional[EventType[()]] = None,
  775. **props,
  776. ) -> "ContextMenuLabel":
  777. """Create a new component instance.
  778. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  779. other UI libraries for common names, like Text and Button.
  780. Args:
  781. *children: Child components.
  782. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  783. style: The style of the component.
  784. key: A unique key for the component.
  785. id: The id for the component.
  786. class_name: The class name for the component.
  787. autofocus: Whether the component should take the focus once the page is loaded
  788. custom_attrs: custom attribute
  789. **props: Component properties.
  790. Returns:
  791. A new component instance.
  792. """
  793. ...
  794. class ContextMenuGroup(RadixThemesComponent):
  795. @overload
  796. @classmethod
  797. def create( # type: ignore
  798. cls,
  799. *children,
  800. as_child: Var[bool] | bool | None = None,
  801. style: Style | None = None,
  802. key: Any | None = None,
  803. id: Any | None = None,
  804. class_name: Any | None = None,
  805. autofocus: bool | None = None,
  806. custom_attrs: dict[str, Var | Any] | None = None,
  807. on_blur: Optional[EventType[()]] = None,
  808. on_click: Optional[EventType[()]] = None,
  809. on_context_menu: Optional[EventType[()]] = None,
  810. on_double_click: Optional[EventType[()]] = None,
  811. on_focus: Optional[EventType[()]] = None,
  812. on_mount: Optional[EventType[()]] = None,
  813. on_mouse_down: Optional[EventType[()]] = None,
  814. on_mouse_enter: Optional[EventType[()]] = None,
  815. on_mouse_leave: Optional[EventType[()]] = None,
  816. on_mouse_move: Optional[EventType[()]] = None,
  817. on_mouse_out: Optional[EventType[()]] = None,
  818. on_mouse_over: Optional[EventType[()]] = None,
  819. on_mouse_up: Optional[EventType[()]] = None,
  820. on_scroll: Optional[EventType[()]] = None,
  821. on_unmount: Optional[EventType[()]] = None,
  822. **props,
  823. ) -> "ContextMenuGroup":
  824. """Create a new component instance.
  825. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  826. other UI libraries for common names, like Text and Button.
  827. Args:
  828. *children: Child components.
  829. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  830. style: The style of the component.
  831. key: A unique key for the component.
  832. id: The id for the component.
  833. class_name: The class name for the component.
  834. autofocus: Whether the component should take the focus once the page is loaded
  835. custom_attrs: custom attribute
  836. **props: Component properties.
  837. Returns:
  838. A new component instance.
  839. """
  840. ...
  841. class ContextMenuRadioGroup(RadixThemesComponent):
  842. @overload
  843. @classmethod
  844. def create( # type: ignore
  845. cls,
  846. *children,
  847. as_child: Var[bool] | bool | None = None,
  848. value: Var[str] | str | None = None,
  849. style: Style | None = None,
  850. key: Any | None = None,
  851. id: Any | None = None,
  852. class_name: Any | None = None,
  853. autofocus: bool | None = None,
  854. custom_attrs: dict[str, Var | Any] | None = None,
  855. on_blur: Optional[EventType[()]] = None,
  856. on_change: Optional[EventType[()] | EventType[str]] = None,
  857. on_click: Optional[EventType[()]] = None,
  858. on_context_menu: Optional[EventType[()]] = None,
  859. on_double_click: Optional[EventType[()]] = None,
  860. on_focus: Optional[EventType[()]] = None,
  861. on_mount: Optional[EventType[()]] = None,
  862. on_mouse_down: Optional[EventType[()]] = None,
  863. on_mouse_enter: Optional[EventType[()]] = None,
  864. on_mouse_leave: Optional[EventType[()]] = None,
  865. on_mouse_move: Optional[EventType[()]] = None,
  866. on_mouse_out: Optional[EventType[()]] = None,
  867. on_mouse_over: Optional[EventType[()]] = None,
  868. on_mouse_up: Optional[EventType[()]] = None,
  869. on_scroll: Optional[EventType[()]] = None,
  870. on_unmount: Optional[EventType[()]] = None,
  871. **props,
  872. ) -> "ContextMenuRadioGroup":
  873. """Create a new component instance.
  874. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  875. other UI libraries for common names, like Text and Button.
  876. Args:
  877. *children: Child components.
  878. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  879. value: The value of the selected item in the group.
  880. on_change: Fired when the value of the radio group changes.
  881. style: The style of the component.
  882. key: A unique key for the component.
  883. id: The id for the component.
  884. class_name: The class name for the component.
  885. autofocus: Whether the component should take the focus once the page is loaded
  886. custom_attrs: custom attribute
  887. **props: Component properties.
  888. Returns:
  889. A new component instance.
  890. """
  891. ...
  892. class ContextMenuRadioItem(HighLevelRadioGroup):
  893. @overload
  894. @classmethod
  895. def create( # type: ignore
  896. cls,
  897. *children,
  898. color_scheme: Literal[
  899. "amber",
  900. "blue",
  901. "bronze",
  902. "brown",
  903. "crimson",
  904. "cyan",
  905. "gold",
  906. "grass",
  907. "gray",
  908. "green",
  909. "indigo",
  910. "iris",
  911. "jade",
  912. "lime",
  913. "mint",
  914. "orange",
  915. "pink",
  916. "plum",
  917. "purple",
  918. "red",
  919. "ruby",
  920. "sky",
  921. "teal",
  922. "tomato",
  923. "violet",
  924. "yellow",
  925. ]
  926. | Var[
  927. Literal[
  928. "amber",
  929. "blue",
  930. "bronze",
  931. "brown",
  932. "crimson",
  933. "cyan",
  934. "gold",
  935. "grass",
  936. "gray",
  937. "green",
  938. "indigo",
  939. "iris",
  940. "jade",
  941. "lime",
  942. "mint",
  943. "orange",
  944. "pink",
  945. "plum",
  946. "purple",
  947. "red",
  948. "ruby",
  949. "sky",
  950. "teal",
  951. "tomato",
  952. "violet",
  953. "yellow",
  954. ]
  955. ]
  956. | None = None,
  957. as_child: Var[bool] | bool | None = None,
  958. value: Var[str] | str | None = None,
  959. disabled: Var[bool] | bool | None = None,
  960. text_value: Var[str] | str | None = None,
  961. items: Sequence[str] | Var[Sequence[str]] | None = None,
  962. direction: Literal["column", "column-reverse", "row", "row-reverse"]
  963. | Var[Literal["column", "column-reverse", "row", "row-reverse"]]
  964. | None = None,
  965. spacing: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
  966. | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
  967. | None = None,
  968. size: Literal["1", "2", "3"] | Var[Literal["1", "2", "3"]] | None = None,
  969. variant: Literal["classic", "soft", "surface"]
  970. | Var[Literal["classic", "soft", "surface"]]
  971. | None = None,
  972. high_contrast: Var[bool] | bool | None = None,
  973. default_value: Var[str] | str | None = None,
  974. name: Var[str] | str | None = None,
  975. required: Var[bool] | bool | None = None,
  976. style: Style | None = None,
  977. key: Any | None = None,
  978. id: Any | None = None,
  979. class_name: Any | None = None,
  980. autofocus: bool | None = None,
  981. custom_attrs: dict[str, Var | Any] | None = None,
  982. on_blur: Optional[EventType[()]] = None,
  983. on_click: Optional[EventType[()]] = None,
  984. on_context_menu: Optional[EventType[()]] = None,
  985. on_double_click: Optional[EventType[()]] = None,
  986. on_focus: Optional[EventType[()]] = None,
  987. on_mount: Optional[EventType[()]] = None,
  988. on_mouse_down: Optional[EventType[()]] = None,
  989. on_mouse_enter: Optional[EventType[()]] = None,
  990. on_mouse_leave: Optional[EventType[()]] = None,
  991. on_mouse_move: Optional[EventType[()]] = None,
  992. on_mouse_out: Optional[EventType[()]] = None,
  993. on_mouse_over: Optional[EventType[()]] = None,
  994. on_mouse_up: Optional[EventType[()]] = None,
  995. on_scroll: Optional[EventType[()]] = None,
  996. on_select: Optional[EventType[()]] = None,
  997. on_unmount: Optional[EventType[()]] = None,
  998. **props,
  999. ) -> "ContextMenuRadioItem":
  1000. """Create a radio group component.
  1001. Args:
  1002. items: The items of the radio group.
  1003. color_scheme: The color of the radio group
  1004. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
  1005. value: The controlled value of the radio item to check. Should be used in conjunction with on_change.
  1006. disabled: Whether the radio group is disabled
  1007. on_select: Event handler called when the user selects an item (via mouse or keyboard). Calling event.preventDefault in this handler will prevent the context menu from closing when selecting that item.
  1008. text_value: Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
  1009. items: The items of the radio group.
  1010. direction: The direction of the radio group.
  1011. spacing: The gap between the items of the radio group.
  1012. size: The size of the radio group.
  1013. variant: The variant of the radio group
  1014. high_contrast: Whether to render the radio group with higher contrast color against background
  1015. default_value: The initial value of checked radio item. Should be used in conjunction with on_change.
  1016. name: The name of the group. Submitted with its owning form as part of a name/value pair.
  1017. required: Whether the radio group is required
  1018. style: The style of the component.
  1019. key: A unique key for the component.
  1020. id: The id for the component.
  1021. class_name: The class name for the component.
  1022. autofocus: Whether the component should take the focus once the page is loaded
  1023. custom_attrs: custom attribute
  1024. **props: Additional properties to apply to the accordion item.
  1025. Returns:
  1026. The created radio group component.
  1027. Raises:
  1028. TypeError: If the type of items is invalid.
  1029. """
  1030. ...
  1031. class ContextMenu(ComponentNamespace):
  1032. root = staticmethod(ContextMenuRoot.create)
  1033. trigger = staticmethod(ContextMenuTrigger.create)
  1034. content = staticmethod(ContextMenuContent.create)
  1035. sub = staticmethod(ContextMenuSub.create)
  1036. sub_trigger = staticmethod(ContextMenuSubTrigger.create)
  1037. sub_content = staticmethod(ContextMenuSubContent.create)
  1038. item = staticmethod(ContextMenuItem.create)
  1039. separator = staticmethod(ContextMenuSeparator.create)
  1040. checkbox = staticmethod(ContextMenuCheckbox.create)
  1041. label = staticmethod(ContextMenuLabel.create)
  1042. group = staticmethod(ContextMenuGroup.create)
  1043. radio_group = staticmethod(ContextMenuRadioGroup.create)
  1044. radio = staticmethod(ContextMenuRadioItem.create)
  1045. context_menu = ContextMenu()