image.pyi 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. """Stub file for reflex/components/next/image.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.event import EventType
  7. from reflex.style import Style
  8. from reflex.vars.base import Var
  9. from .base import NextComponent
  10. DEFAULT_W_H = "100%"
  11. class Image(NextComponent):
  12. @overload
  13. @classmethod
  14. def create( # type: ignore
  15. cls,
  16. *children,
  17. width: Optional[Union[int, str]] = None,
  18. height: Optional[Union[int, str]] = None,
  19. src: Optional[Union[Any, Var[Any]]] = None,
  20. alt: Optional[Union[Var[str], str]] = None,
  21. loader: Optional[Union[Any, Var[Any]]] = None,
  22. fill: Optional[Union[Var[bool], bool]] = None,
  23. sizes: Optional[Union[Var[str], str]] = None,
  24. quality: Optional[Union[Var[int], int]] = None,
  25. priority: Optional[Union[Var[bool], bool]] = None,
  26. placeholder: Optional[Union[Var[str], str]] = None,
  27. loading: Optional[
  28. Union[Literal["eager", "lazy"], Var[Literal["eager", "lazy"]]]
  29. ] = None,
  30. blur_data_url: Optional[Union[Var[str], str]] = None,
  31. style: Optional[Style] = None,
  32. key: Optional[Any] = None,
  33. id: Optional[Any] = None,
  34. class_name: Optional[Any] = None,
  35. autofocus: Optional[bool] = None,
  36. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  37. on_blur: Optional[EventType[()]] = None,
  38. on_click: Optional[EventType[()]] = None,
  39. on_context_menu: Optional[EventType[()]] = None,
  40. on_double_click: Optional[EventType[()]] = None,
  41. on_error: Optional[EventType[()]] = None,
  42. on_focus: Optional[EventType[()]] = None,
  43. on_load: Optional[EventType[()]] = None,
  44. on_mount: Optional[EventType[()]] = None,
  45. on_mouse_down: Optional[EventType[()]] = None,
  46. on_mouse_enter: Optional[EventType[()]] = None,
  47. on_mouse_leave: Optional[EventType[()]] = None,
  48. on_mouse_move: Optional[EventType[()]] = None,
  49. on_mouse_out: Optional[EventType[()]] = None,
  50. on_mouse_over: Optional[EventType[()]] = None,
  51. on_mouse_up: Optional[EventType[()]] = None,
  52. on_scroll: Optional[EventType[()]] = None,
  53. on_unmount: Optional[EventType[()]] = None,
  54. **props,
  55. ) -> "Image":
  56. """Create an Image component from next/image.
  57. Args:
  58. *children: The children of the component.
  59. width: The width of the image.
  60. height: The height of the image.
  61. src: This can be either an absolute external URL, or an internal path
  62. alt: Used to describe the image for screen readers and search engines.
  63. loader: A custom function used to resolve image URLs.
  64. fill: A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
  65. sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
  66. quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
  67. priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
  68. placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
  69. loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
  70. blur_data_url: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
  71. on_load: Fires when the image has loaded.
  72. on_error: Fires when the image has an error.
  73. style: The style of the component.
  74. key: A unique key for the component.
  75. id: The id for the component.
  76. class_name: The class name for the component.
  77. autofocus: Whether the component should take the focus once the page is loaded
  78. custom_attrs: custom attribute
  79. **props:The props of the component.
  80. Returns:
  81. _type_: _description_
  82. """
  83. ...