drawer.pyi 29 KB

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