123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635 |
- """Stub file for reflex/components/radix/primitives/drawer.py"""
- # ------------------- DO NOT EDIT ----------------------
- # This file was generated by `reflex/utils/pyi_generator.py`!
- # ------------------------------------------------------
- from typing import Any, Dict, List, Literal, Optional, Union, overload
- from reflex.components.component import ComponentNamespace
- from reflex.components.radix.primitives.base import RadixPrimitiveComponent
- from reflex.event import BASE_STATE, EventType
- from reflex.style import Style
- from reflex.vars.base import Var
- class DrawerComponent(RadixPrimitiveComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerComponent":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- LiteralDirectionType = Literal["top", "bottom", "left", "right"]
- class DrawerRoot(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- default_open: Optional[Union[Var[bool], bool]] = None,
- open: Optional[Union[Var[bool], bool]] = None,
- modal: Optional[Union[Var[bool], bool]] = None,
- direction: Optional[
- Union[
- Literal["bottom", "left", "right", "top"],
- Var[Literal["bottom", "left", "right", "top"]],
- ]
- ] = None,
- dismissible: Optional[Union[Var[bool], bool]] = None,
- handle_only: Optional[Union[Var[bool], bool]] = None,
- snap_points: Optional[List[Union[float, str]]] = None,
- fade_from_index: Optional[Union[Var[int], int]] = None,
- scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
- preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
- should_scale_background: Optional[Union[Var[bool], bool]] = None,
- close_threshold: Optional[Union[Var[float], float]] = None,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_animation_end: Optional[
- Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
- ] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_open_change: Optional[
- Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
- ] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerRoot":
- """Create the component.
- Args:
- *children: The children of the component.
- default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
- open: Whether the drawer is open or not.
- on_open_change: Fires when the drawer is opened or closed.
- modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
- direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
- 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.
- 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.
- handle_only: When `True`, dragging will only be possible by the handle.
- 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.
- fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
- scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
- preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
- should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
- close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class DrawerTrigger(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerTrigger":
- """Create a new DrawerTrigger instance.
- Args:
- *children: The children of the element.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The properties of the element.
- Returns:
- The new DrawerTrigger instance.
- """
- ...
- class DrawerPortal(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerPortal":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class DrawerContent(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_close_auto_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_escape_key_down: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_interact_outside: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_open_auto_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_pointer_down_outside: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerContent":
- """Create a Drawer Content.
- We wrap the Drawer content in an `rx.theme` to make radix themes definitions available to
- rendered div in the DOM. This is because Vaul Drawer injects the Drawer overlay content in a sibling
- div to the root div rendered by radix which contains styling definitions. Wrapping in `rx.theme`
- makes the styling available to the overlay.
- Args:
- *children: The list of children to use.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: Additional properties to apply to the drawer content.
- Returns:
- The drawer content.
- """
- ...
- class DrawerOverlay(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerOverlay":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class DrawerClose(DrawerTrigger):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerClose":
- """Create a new DrawerTrigger instance.
- Args:
- *children: The children of the element.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The properties of the element.
- Returns:
- The new DrawerTrigger instance.
- """
- ...
- class DrawerTitle(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerTitle":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class DrawerDescription(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerDescription":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class DrawerHandle(DrawerComponent):
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerHandle":
- """Create the component.
- Args:
- *children: The children of the component.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- class Drawer(ComponentNamespace):
- root = staticmethod(DrawerRoot.create)
- trigger = staticmethod(DrawerTrigger.create)
- portal = staticmethod(DrawerPortal.create)
- content = staticmethod(DrawerContent.create)
- overlay = staticmethod(DrawerOverlay.create)
- close = staticmethod(DrawerClose.create)
- title = staticmethod(DrawerTitle.create)
- description = staticmethod(DrawerDescription.create)
- handle = staticmethod(DrawerHandle.create)
- @staticmethod
- def __call__(
- *children,
- default_open: Optional[Union[Var[bool], bool]] = None,
- open: Optional[Union[Var[bool], bool]] = None,
- modal: Optional[Union[Var[bool], bool]] = None,
- direction: Optional[
- Union[
- Literal["bottom", "left", "right", "top"],
- Var[Literal["bottom", "left", "right", "top"]],
- ]
- ] = None,
- dismissible: Optional[Union[Var[bool], bool]] = None,
- handle_only: Optional[Union[Var[bool], bool]] = None,
- snap_points: Optional[List[Union[float, str]]] = None,
- fade_from_index: Optional[Union[Var[int], int]] = None,
- scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
- preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
- should_scale_background: Optional[Union[Var[bool], bool]] = None,
- close_threshold: Optional[Union[Var[float], float]] = None,
- as_child: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_animation_end: Optional[
- Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
- ] = None,
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
- on_click: Optional[EventType[[], BASE_STATE]] = None,
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
- on_open_change: Optional[
- Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
- ] = None,
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
- **props,
- ) -> "DrawerRoot":
- """Create the component.
- Args:
- *children: The children of the component.
- default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
- open: Whether the drawer is open or not.
- on_open_change: Fires when the drawer is opened or closed.
- modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
- direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
- 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.
- 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.
- handle_only: When `True`, dragging will only be possible by the handle.
- 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.
- fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
- scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
- preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
- should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
- close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
- as_child: Change the default rendered element for the one passed as a child.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
- drawer = Drawer()
|