image.pyi 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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, Literal, Optional, 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: int | str | None = None,
  18. height: int | str | None = None,
  19. src: Any | Var[Any] | None = None,
  20. alt: Var[str] | str | None = None,
  21. loader: Any | Var[Any] | None = None,
  22. fill: Var[bool] | bool | None = None,
  23. sizes: Var[str] | str | None = None,
  24. quality: Var[int] | int | None = None,
  25. priority: Var[bool] | bool | None = None,
  26. placeholder: Var[str] | str | None = None,
  27. loading: Literal["eager", "lazy"] | Var[Literal["eager", "lazy"]] | None = None,
  28. blur_data_url: Var[str] | str | None = None,
  29. style: Style | None = None,
  30. key: Any | None = None,
  31. id: Any | None = None,
  32. class_name: Any | None = None,
  33. autofocus: bool | None = None,
  34. custom_attrs: dict[str, Var | Any] | None = None,
  35. on_blur: Optional[EventType[()]] = None,
  36. on_click: Optional[EventType[()]] = None,
  37. on_context_menu: Optional[EventType[()]] = None,
  38. on_double_click: Optional[EventType[()]] = None,
  39. on_error: Optional[EventType[()]] = None,
  40. on_focus: Optional[EventType[()]] = None,
  41. on_load: Optional[EventType[()]] = None,
  42. on_mount: Optional[EventType[()]] = None,
  43. on_mouse_down: Optional[EventType[()]] = None,
  44. on_mouse_enter: Optional[EventType[()]] = None,
  45. on_mouse_leave: Optional[EventType[()]] = None,
  46. on_mouse_move: Optional[EventType[()]] = None,
  47. on_mouse_out: Optional[EventType[()]] = None,
  48. on_mouse_over: Optional[EventType[()]] = None,
  49. on_mouse_up: Optional[EventType[()]] = None,
  50. on_scroll: Optional[EventType[()]] = None,
  51. on_unmount: Optional[EventType[()]] = None,
  52. **props,
  53. ) -> "Image":
  54. """Create an Image component from next/image.
  55. Args:
  56. *children: The children of the component.
  57. width: The width of the image.
  58. height: The height of the image.
  59. src: This can be either an absolute external URL, or an internal path
  60. alt: Used to describe the image for screen readers and search engines.
  61. loader: A custom function used to resolve image URLs.
  62. 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
  63. sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
  64. 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.
  65. priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
  66. placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
  67. loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
  68. 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".
  69. on_load: Fires when the image has loaded.
  70. on_error: Fires when the image has an error.
  71. style: The style of the component.
  72. key: A unique key for the component.
  73. id: The id for the component.
  74. class_name: The class name for the component.
  75. autofocus: Whether the component should take the focus once the page is loaded
  76. custom_attrs: custom attribute
  77. **props:The props of the component.
  78. Returns:
  79. _type_: _description_
  80. """
  81. ...