drawer.pyi 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. """Stub file for reflex/components/radix/primitives/drawer.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, List, Literal, Optional, Union, overload
  6. from reflex.components.component import ComponentNamespace
  7. from reflex.components.radix.primitives.base import RadixPrimitiveComponent
  8. from reflex.event import EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. class DrawerComponent(RadixPrimitiveComponent):
  12. @overload
  13. @classmethod
  14. def create( # type: ignore
  15. cls,
  16. *children,
  17. as_child: Optional[Union[Var[bool], bool]] = None,
  18. style: Optional[Style] = None,
  19. key: Optional[Any] = None,
  20. id: Optional[Any] = None,
  21. class_name: Optional[Any] = None,
  22. autofocus: Optional[bool] = None,
  23. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  24. on_blur: Optional[EventType[()]] = None,
  25. on_click: Optional[EventType[()]] = None,
  26. on_context_menu: Optional[EventType[()]] = None,
  27. on_double_click: Optional[EventType[()]] = None,
  28. on_focus: Optional[EventType[()]] = None,
  29. on_mount: Optional[EventType[()]] = None,
  30. on_mouse_down: Optional[EventType[()]] = None,
  31. on_mouse_enter: Optional[EventType[()]] = None,
  32. on_mouse_leave: Optional[EventType[()]] = None,
  33. on_mouse_move: Optional[EventType[()]] = None,
  34. on_mouse_out: Optional[EventType[()]] = None,
  35. on_mouse_over: Optional[EventType[()]] = None,
  36. on_mouse_up: Optional[EventType[()]] = None,
  37. on_scroll: Optional[EventType[()]] = None,
  38. on_unmount: Optional[EventType[()]] = None,
  39. **props,
  40. ) -> "DrawerComponent":
  41. """Create the component.
  42. Args:
  43. *children: The children of the component.
  44. as_child: Change the default rendered element for the one passed as a child.
  45. style: The style of the component.
  46. key: A unique key for the component.
  47. id: The id for the component.
  48. class_name: The class name for the component.
  49. autofocus: Whether the component should take the focus once the page is loaded
  50. custom_attrs: custom attribute
  51. **props: The props of the component.
  52. Returns:
  53. The component.
  54. """
  55. ...
  56. LiteralDirectionType = Literal["top", "bottom", "left", "right"]
  57. class DrawerRoot(DrawerComponent):
  58. @overload
  59. @classmethod
  60. def create( # type: ignore
  61. cls,
  62. *children,
  63. default_open: Optional[Union[Var[bool], bool]] = None,
  64. open: Optional[Union[Var[bool], bool]] = None,
  65. modal: Optional[Union[Var[bool], bool]] = None,
  66. direction: Optional[
  67. Union[
  68. Literal["bottom", "left", "right", "top"],
  69. Var[Literal["bottom", "left", "right", "top"]],
  70. ]
  71. ] = None,
  72. dismissible: Optional[Union[Var[bool], bool]] = None,
  73. handle_only: Optional[Union[Var[bool], bool]] = None,
  74. snap_points: Optional[List[Union[float, str]]] = None,
  75. fade_from_index: Optional[Union[Var[int], int]] = None,
  76. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  77. prevent_scroll_restoration: Optional[Union[Var[bool], bool]] = None,
  78. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  79. close_threshold: Optional[Union[Var[float], float]] = None,
  80. as_child: Optional[Union[Var[bool], bool]] = None,
  81. style: Optional[Style] = None,
  82. key: Optional[Any] = None,
  83. id: Optional[Any] = None,
  84. class_name: Optional[Any] = None,
  85. autofocus: Optional[bool] = None,
  86. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  87. on_animation_end: Optional[Union[EventType[()], EventType[bool]]] = None,
  88. on_blur: Optional[EventType[()]] = None,
  89. on_click: Optional[EventType[()]] = None,
  90. on_context_menu: Optional[EventType[()]] = None,
  91. on_double_click: Optional[EventType[()]] = None,
  92. on_focus: Optional[EventType[()]] = None,
  93. on_mount: Optional[EventType[()]] = None,
  94. on_mouse_down: Optional[EventType[()]] = None,
  95. on_mouse_enter: Optional[EventType[()]] = None,
  96. on_mouse_leave: Optional[EventType[()]] = None,
  97. on_mouse_move: Optional[EventType[()]] = None,
  98. on_mouse_out: Optional[EventType[()]] = None,
  99. on_mouse_over: Optional[EventType[()]] = None,
  100. on_mouse_up: Optional[EventType[()]] = None,
  101. on_open_change: Optional[Union[EventType[()], EventType[bool]]] = None,
  102. on_scroll: Optional[EventType[()]] = None,
  103. on_unmount: Optional[EventType[()]] = None,
  104. **props,
  105. ) -> "DrawerRoot":
  106. """Create the component.
  107. Args:
  108. *children: The children of the component.
  109. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
  110. open: Whether the drawer is open or not.
  111. on_open_change: Fires when the drawer is opened or closed.
  112. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
  113. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
  114. on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered.
  115. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer.
  116. handle_only: When `True`, dragging will only be possible by the handle.
  117. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account.
  118. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  119. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  120. prevent_scroll_restoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  121. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
  122. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  123. as_child: Change the default rendered element for the one passed as a child.
  124. style: The style of the component.
  125. key: A unique key for the component.
  126. id: The id for the component.
  127. class_name: The class name for the component.
  128. autofocus: Whether the component should take the focus once the page is loaded
  129. custom_attrs: custom attribute
  130. **props: The props of the component.
  131. Returns:
  132. The component.
  133. """
  134. ...
  135. class DrawerTrigger(DrawerComponent):
  136. @overload
  137. @classmethod
  138. def create( # type: ignore
  139. cls,
  140. *children,
  141. as_child: Optional[Union[Var[bool], bool]] = None,
  142. style: Optional[Style] = None,
  143. key: Optional[Any] = None,
  144. id: Optional[Any] = None,
  145. class_name: Optional[Any] = None,
  146. autofocus: Optional[bool] = None,
  147. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  148. on_blur: Optional[EventType[()]] = None,
  149. on_click: Optional[EventType[()]] = None,
  150. on_context_menu: Optional[EventType[()]] = None,
  151. on_double_click: Optional[EventType[()]] = None,
  152. on_focus: Optional[EventType[()]] = None,
  153. on_mount: Optional[EventType[()]] = None,
  154. on_mouse_down: Optional[EventType[()]] = None,
  155. on_mouse_enter: Optional[EventType[()]] = None,
  156. on_mouse_leave: Optional[EventType[()]] = None,
  157. on_mouse_move: Optional[EventType[()]] = None,
  158. on_mouse_out: Optional[EventType[()]] = None,
  159. on_mouse_over: Optional[EventType[()]] = None,
  160. on_mouse_up: Optional[EventType[()]] = None,
  161. on_scroll: Optional[EventType[()]] = None,
  162. on_unmount: Optional[EventType[()]] = None,
  163. **props,
  164. ) -> "DrawerTrigger":
  165. """Create a new DrawerTrigger instance.
  166. Args:
  167. *children: The children of the element.
  168. as_child: Change the default rendered element for the one passed as a child.
  169. style: The style of the component.
  170. key: A unique key for the component.
  171. id: The id for the component.
  172. class_name: The class name for the component.
  173. autofocus: Whether the component should take the focus once the page is loaded
  174. custom_attrs: custom attribute
  175. **props: The properties of the element.
  176. Returns:
  177. The new DrawerTrigger instance.
  178. """
  179. ...
  180. class DrawerPortal(DrawerComponent):
  181. @overload
  182. @classmethod
  183. def create( # type: ignore
  184. cls,
  185. *children,
  186. as_child: Optional[Union[Var[bool], bool]] = None,
  187. style: Optional[Style] = None,
  188. key: Optional[Any] = None,
  189. id: Optional[Any] = None,
  190. class_name: Optional[Any] = None,
  191. autofocus: Optional[bool] = None,
  192. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  193. on_blur: Optional[EventType[()]] = None,
  194. on_click: Optional[EventType[()]] = None,
  195. on_context_menu: Optional[EventType[()]] = None,
  196. on_double_click: Optional[EventType[()]] = None,
  197. on_focus: Optional[EventType[()]] = None,
  198. on_mount: Optional[EventType[()]] = None,
  199. on_mouse_down: Optional[EventType[()]] = None,
  200. on_mouse_enter: Optional[EventType[()]] = None,
  201. on_mouse_leave: Optional[EventType[()]] = None,
  202. on_mouse_move: Optional[EventType[()]] = None,
  203. on_mouse_out: Optional[EventType[()]] = None,
  204. on_mouse_over: Optional[EventType[()]] = None,
  205. on_mouse_up: Optional[EventType[()]] = None,
  206. on_scroll: Optional[EventType[()]] = None,
  207. on_unmount: Optional[EventType[()]] = None,
  208. **props,
  209. ) -> "DrawerPortal":
  210. """Create the component.
  211. Args:
  212. *children: The children of the component.
  213. as_child: Change the default rendered element for the one passed as a child.
  214. style: The style of the component.
  215. key: A unique key for the component.
  216. id: The id for the component.
  217. class_name: The class name for the component.
  218. autofocus: Whether the component should take the focus once the page is loaded
  219. custom_attrs: custom attribute
  220. **props: The props of the component.
  221. Returns:
  222. The component.
  223. """
  224. ...
  225. class DrawerContent(DrawerComponent):
  226. @overload
  227. @classmethod
  228. def create( # type: ignore
  229. cls,
  230. *children,
  231. as_child: Optional[Union[Var[bool], bool]] = None,
  232. style: Optional[Style] = None,
  233. key: Optional[Any] = None,
  234. id: Optional[Any] = None,
  235. class_name: Optional[Any] = None,
  236. autofocus: Optional[bool] = None,
  237. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  238. on_blur: Optional[EventType[()]] = None,
  239. on_click: Optional[EventType[()]] = None,
  240. on_close_auto_focus: Optional[EventType[()]] = None,
  241. on_context_menu: Optional[EventType[()]] = None,
  242. on_double_click: Optional[EventType[()]] = None,
  243. on_escape_key_down: Optional[EventType[()]] = None,
  244. on_focus: Optional[EventType[()]] = None,
  245. on_interact_outside: Optional[EventType[()]] = None,
  246. on_mount: Optional[EventType[()]] = None,
  247. on_mouse_down: Optional[EventType[()]] = None,
  248. on_mouse_enter: Optional[EventType[()]] = None,
  249. on_mouse_leave: Optional[EventType[()]] = None,
  250. on_mouse_move: Optional[EventType[()]] = None,
  251. on_mouse_out: Optional[EventType[()]] = None,
  252. on_mouse_over: Optional[EventType[()]] = None,
  253. on_mouse_up: Optional[EventType[()]] = None,
  254. on_open_auto_focus: Optional[EventType[()]] = None,
  255. on_pointer_down_outside: Optional[EventType[()]] = None,
  256. on_scroll: Optional[EventType[()]] = None,
  257. on_unmount: Optional[EventType[()]] = None,
  258. **props,
  259. ) -> "DrawerContent":
  260. """Create a Drawer Content.
  261. We wrap the Drawer content in an `rx.theme` to make radix themes definitions available to
  262. rendered div in the DOM. This is because Vaul Drawer injects the Drawer overlay content in a sibling
  263. div to the root div rendered by radix which contains styling definitions. Wrapping in `rx.theme`
  264. makes the styling available to the overlay.
  265. Args:
  266. *children: The list of children to use.
  267. as_child: Change the default rendered element for the one passed as a child.
  268. style: The style of the component.
  269. key: A unique key for the component.
  270. id: The id for the component.
  271. class_name: The class name for the component.
  272. autofocus: Whether the component should take the focus once the page is loaded
  273. custom_attrs: custom attribute
  274. **props: Additional properties to apply to the drawer content.
  275. Returns:
  276. The drawer content.
  277. """
  278. ...
  279. class DrawerOverlay(DrawerComponent):
  280. @overload
  281. @classmethod
  282. def create( # type: ignore
  283. cls,
  284. *children,
  285. as_child: Optional[Union[Var[bool], bool]] = None,
  286. style: Optional[Style] = None,
  287. key: Optional[Any] = None,
  288. id: Optional[Any] = None,
  289. class_name: Optional[Any] = None,
  290. autofocus: Optional[bool] = None,
  291. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  292. on_blur: Optional[EventType[()]] = None,
  293. on_click: Optional[EventType[()]] = None,
  294. on_context_menu: Optional[EventType[()]] = None,
  295. on_double_click: Optional[EventType[()]] = None,
  296. on_focus: Optional[EventType[()]] = None,
  297. on_mount: Optional[EventType[()]] = None,
  298. on_mouse_down: Optional[EventType[()]] = None,
  299. on_mouse_enter: Optional[EventType[()]] = None,
  300. on_mouse_leave: Optional[EventType[()]] = None,
  301. on_mouse_move: Optional[EventType[()]] = None,
  302. on_mouse_out: Optional[EventType[()]] = None,
  303. on_mouse_over: Optional[EventType[()]] = None,
  304. on_mouse_up: Optional[EventType[()]] = None,
  305. on_scroll: Optional[EventType[()]] = None,
  306. on_unmount: Optional[EventType[()]] = None,
  307. **props,
  308. ) -> "DrawerOverlay":
  309. """Create the component.
  310. Args:
  311. *children: The children of the component.
  312. as_child: Change the default rendered element for the one passed as a child.
  313. style: The style of the component.
  314. key: A unique key for the component.
  315. id: The id for the component.
  316. class_name: The class name for the component.
  317. autofocus: Whether the component should take the focus once the page is loaded
  318. custom_attrs: custom attribute
  319. **props: The props of the component.
  320. Returns:
  321. The component.
  322. """
  323. ...
  324. class DrawerClose(DrawerTrigger):
  325. @overload
  326. @classmethod
  327. def create( # type: ignore
  328. cls,
  329. *children,
  330. as_child: Optional[Union[Var[bool], bool]] = None,
  331. style: Optional[Style] = None,
  332. key: Optional[Any] = None,
  333. id: Optional[Any] = None,
  334. class_name: Optional[Any] = None,
  335. autofocus: Optional[bool] = None,
  336. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  337. on_blur: Optional[EventType[()]] = None,
  338. on_click: Optional[EventType[()]] = None,
  339. on_context_menu: Optional[EventType[()]] = None,
  340. on_double_click: Optional[EventType[()]] = None,
  341. on_focus: Optional[EventType[()]] = None,
  342. on_mount: Optional[EventType[()]] = None,
  343. on_mouse_down: Optional[EventType[()]] = None,
  344. on_mouse_enter: Optional[EventType[()]] = None,
  345. on_mouse_leave: Optional[EventType[()]] = None,
  346. on_mouse_move: Optional[EventType[()]] = None,
  347. on_mouse_out: Optional[EventType[()]] = None,
  348. on_mouse_over: Optional[EventType[()]] = None,
  349. on_mouse_up: Optional[EventType[()]] = None,
  350. on_scroll: Optional[EventType[()]] = None,
  351. on_unmount: Optional[EventType[()]] = None,
  352. **props,
  353. ) -> "DrawerClose":
  354. """Create a new DrawerTrigger instance.
  355. Args:
  356. *children: The children of the element.
  357. as_child: Change the default rendered element for the one passed as a child.
  358. style: The style of the component.
  359. key: A unique key for the component.
  360. id: The id for the component.
  361. class_name: The class name for the component.
  362. autofocus: Whether the component should take the focus once the page is loaded
  363. custom_attrs: custom attribute
  364. **props: The properties of the element.
  365. Returns:
  366. The new DrawerTrigger instance.
  367. """
  368. ...
  369. class DrawerTitle(DrawerComponent):
  370. @overload
  371. @classmethod
  372. def create( # type: ignore
  373. cls,
  374. *children,
  375. as_child: Optional[Union[Var[bool], bool]] = None,
  376. style: Optional[Style] = None,
  377. key: Optional[Any] = None,
  378. id: Optional[Any] = None,
  379. class_name: Optional[Any] = None,
  380. autofocus: Optional[bool] = None,
  381. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  382. on_blur: Optional[EventType[()]] = None,
  383. on_click: Optional[EventType[()]] = None,
  384. on_context_menu: Optional[EventType[()]] = None,
  385. on_double_click: Optional[EventType[()]] = None,
  386. on_focus: Optional[EventType[()]] = None,
  387. on_mount: Optional[EventType[()]] = None,
  388. on_mouse_down: Optional[EventType[()]] = None,
  389. on_mouse_enter: Optional[EventType[()]] = None,
  390. on_mouse_leave: Optional[EventType[()]] = None,
  391. on_mouse_move: Optional[EventType[()]] = None,
  392. on_mouse_out: Optional[EventType[()]] = None,
  393. on_mouse_over: Optional[EventType[()]] = None,
  394. on_mouse_up: Optional[EventType[()]] = None,
  395. on_scroll: Optional[EventType[()]] = None,
  396. on_unmount: Optional[EventType[()]] = None,
  397. **props,
  398. ) -> "DrawerTitle":
  399. """Create the component.
  400. Args:
  401. *children: The children of the component.
  402. as_child: Change the default rendered element for the one passed as a child.
  403. style: The style of the component.
  404. key: A unique key for the component.
  405. id: The id for the component.
  406. class_name: The class name for the component.
  407. autofocus: Whether the component should take the focus once the page is loaded
  408. custom_attrs: custom attribute
  409. **props: The props of the component.
  410. Returns:
  411. The component.
  412. """
  413. ...
  414. class DrawerDescription(DrawerComponent):
  415. @overload
  416. @classmethod
  417. def create( # type: ignore
  418. cls,
  419. *children,
  420. as_child: Optional[Union[Var[bool], bool]] = None,
  421. style: Optional[Style] = None,
  422. key: Optional[Any] = None,
  423. id: Optional[Any] = None,
  424. class_name: Optional[Any] = None,
  425. autofocus: Optional[bool] = None,
  426. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  427. on_blur: Optional[EventType[()]] = None,
  428. on_click: Optional[EventType[()]] = None,
  429. on_context_menu: Optional[EventType[()]] = None,
  430. on_double_click: Optional[EventType[()]] = None,
  431. on_focus: Optional[EventType[()]] = None,
  432. on_mount: Optional[EventType[()]] = None,
  433. on_mouse_down: Optional[EventType[()]] = None,
  434. on_mouse_enter: Optional[EventType[()]] = None,
  435. on_mouse_leave: Optional[EventType[()]] = None,
  436. on_mouse_move: Optional[EventType[()]] = None,
  437. on_mouse_out: Optional[EventType[()]] = None,
  438. on_mouse_over: Optional[EventType[()]] = None,
  439. on_mouse_up: Optional[EventType[()]] = None,
  440. on_scroll: Optional[EventType[()]] = None,
  441. on_unmount: Optional[EventType[()]] = None,
  442. **props,
  443. ) -> "DrawerDescription":
  444. """Create the component.
  445. Args:
  446. *children: The children of the component.
  447. as_child: Change the default rendered element for the one passed as a child.
  448. style: The style of the component.
  449. key: A unique key for the component.
  450. id: The id for the component.
  451. class_name: The class name for the component.
  452. autofocus: Whether the component should take the focus once the page is loaded
  453. custom_attrs: custom attribute
  454. **props: The props of the component.
  455. Returns:
  456. The component.
  457. """
  458. ...
  459. class DrawerHandle(DrawerComponent):
  460. @overload
  461. @classmethod
  462. def create( # type: ignore
  463. cls,
  464. *children,
  465. as_child: Optional[Union[Var[bool], bool]] = None,
  466. style: Optional[Style] = None,
  467. key: Optional[Any] = None,
  468. id: Optional[Any] = None,
  469. class_name: Optional[Any] = None,
  470. autofocus: Optional[bool] = None,
  471. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  472. on_blur: Optional[EventType[()]] = None,
  473. on_click: Optional[EventType[()]] = None,
  474. on_context_menu: Optional[EventType[()]] = None,
  475. on_double_click: Optional[EventType[()]] = None,
  476. on_focus: Optional[EventType[()]] = None,
  477. on_mount: Optional[EventType[()]] = None,
  478. on_mouse_down: Optional[EventType[()]] = None,
  479. on_mouse_enter: Optional[EventType[()]] = None,
  480. on_mouse_leave: Optional[EventType[()]] = None,
  481. on_mouse_move: Optional[EventType[()]] = None,
  482. on_mouse_out: Optional[EventType[()]] = None,
  483. on_mouse_over: Optional[EventType[()]] = None,
  484. on_mouse_up: Optional[EventType[()]] = None,
  485. on_scroll: Optional[EventType[()]] = None,
  486. on_unmount: Optional[EventType[()]] = None,
  487. **props,
  488. ) -> "DrawerHandle":
  489. """Create the component.
  490. Args:
  491. *children: The children of the component.
  492. as_child: Change the default rendered element for the one passed as a child.
  493. style: The style of the component.
  494. key: A unique key for the component.
  495. id: The id for the component.
  496. class_name: The class name for the component.
  497. autofocus: Whether the component should take the focus once the page is loaded
  498. custom_attrs: custom attribute
  499. **props: The props of the component.
  500. Returns:
  501. The component.
  502. """
  503. ...
  504. class Drawer(ComponentNamespace):
  505. root = staticmethod(DrawerRoot.create)
  506. trigger = staticmethod(DrawerTrigger.create)
  507. portal = staticmethod(DrawerPortal.create)
  508. content = staticmethod(DrawerContent.create)
  509. overlay = staticmethod(DrawerOverlay.create)
  510. close = staticmethod(DrawerClose.create)
  511. title = staticmethod(DrawerTitle.create)
  512. description = staticmethod(DrawerDescription.create)
  513. handle = staticmethod(DrawerHandle.create)
  514. @staticmethod
  515. def __call__(
  516. *children,
  517. default_open: Optional[Union[Var[bool], bool]] = None,
  518. open: Optional[Union[Var[bool], bool]] = None,
  519. modal: Optional[Union[Var[bool], bool]] = None,
  520. direction: Optional[
  521. Union[
  522. Literal["bottom", "left", "right", "top"],
  523. Var[Literal["bottom", "left", "right", "top"]],
  524. ]
  525. ] = None,
  526. dismissible: Optional[Union[Var[bool], bool]] = None,
  527. handle_only: Optional[Union[Var[bool], bool]] = None,
  528. snap_points: Optional[List[Union[float, str]]] = None,
  529. fade_from_index: Optional[Union[Var[int], int]] = None,
  530. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  531. prevent_scroll_restoration: Optional[Union[Var[bool], bool]] = None,
  532. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  533. close_threshold: Optional[Union[Var[float], float]] = None,
  534. as_child: Optional[Union[Var[bool], bool]] = None,
  535. style: Optional[Style] = None,
  536. key: Optional[Any] = None,
  537. id: Optional[Any] = None,
  538. class_name: Optional[Any] = None,
  539. autofocus: Optional[bool] = None,
  540. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  541. on_animation_end: Optional[Union[EventType[()], EventType[bool]]] = None,
  542. on_blur: Optional[EventType[()]] = None,
  543. on_click: Optional[EventType[()]] = None,
  544. on_context_menu: Optional[EventType[()]] = None,
  545. on_double_click: Optional[EventType[()]] = None,
  546. on_focus: Optional[EventType[()]] = None,
  547. on_mount: Optional[EventType[()]] = None,
  548. on_mouse_down: Optional[EventType[()]] = None,
  549. on_mouse_enter: Optional[EventType[()]] = None,
  550. on_mouse_leave: Optional[EventType[()]] = None,
  551. on_mouse_move: Optional[EventType[()]] = None,
  552. on_mouse_out: Optional[EventType[()]] = None,
  553. on_mouse_over: Optional[EventType[()]] = None,
  554. on_mouse_up: Optional[EventType[()]] = None,
  555. on_open_change: Optional[Union[EventType[()], EventType[bool]]] = None,
  556. on_scroll: Optional[EventType[()]] = None,
  557. on_unmount: Optional[EventType[()]] = None,
  558. **props,
  559. ) -> "DrawerRoot":
  560. """Create the component.
  561. Args:
  562. *children: The children of the component.
  563. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
  564. open: Whether the drawer is open or not.
  565. on_open_change: Fires when the drawer is opened or closed.
  566. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
  567. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
  568. on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered.
  569. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer.
  570. handle_only: When `True`, dragging will only be possible by the handle.
  571. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account.
  572. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  573. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  574. prevent_scroll_restoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  575. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
  576. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  577. as_child: Change the default rendered element for the one passed as a child.
  578. style: The style of the component.
  579. key: A unique key for the component.
  580. id: The id for the component.
  581. class_name: The class name for the component.
  582. autofocus: Whether the component should take the focus once the page is loaded
  583. custom_attrs: custom attribute
  584. **props: The props of the component.
  585. Returns:
  586. The component.
  587. """
  588. ...
  589. drawer = Drawer()