loading_icon.py 680 B

1234567891011121314151617181920212223242526
  1. import reflex as rx
  2. class LoadingIcon(rx.Component):
  3. """A custom loading icon component."""
  4. library = "react-loading-icons"
  5. tag = "SpinningCircles"
  6. stroke: rx.Var[str]
  7. stroke_opacity: rx.Var[str]
  8. fill: rx.Var[str]
  9. fill_opacity: rx.Var[str]
  10. stroke_width: rx.Var[str]
  11. speed: rx.Var[str]
  12. height: rx.Var[str]
  13. def get_event_triggers(self) -> dict:
  14. """Get the event triggers that pass the component's value to the handler.
  15. Returns:
  16. A dict mapping the event trigger to the var that is passed to the handler.
  17. """
  18. return {"on_change": lambda status: [status]}
  19. loading_icon = LoadingIcon.create