drawer.pyi 28 KB

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