skeleton.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. """Container to stack elements with spacing."""
  2. from reflex.components.libs.chakra import ChakraComponent
  3. from reflex.vars import Var
  4. class Skeleton(ChakraComponent):
  5. """Skeleton is used to display the loading state of some components. You can use it as a standalone component. Or to wrap another component to take the same height and width."""
  6. tag = "Skeleton"
  7. # The color at the animation end
  8. end_color: Var[str]
  9. # The fadeIn duration in seconds
  10. fade_duration: Var[float]
  11. # If true, it'll render its children with a nice fade transition
  12. is_loaded: Var[bool]
  13. # The animation speed in seconds
  14. speed: Var[float]
  15. # The color at the animation start
  16. start_color: Var[str]
  17. class SkeletonCircle(ChakraComponent):
  18. """SkeletonCircle is used to display the loading state of some components."""
  19. tag = "SkeletonCircle"
  20. # The color at the animation end
  21. end_color: Var[str]
  22. # The fadeIn duration in seconds
  23. fade_duration: Var[float]
  24. # If true, it'll render its children with a nice fade transition
  25. is_loaded: Var[bool]
  26. # The animation speed in seconds
  27. speed: Var[float]
  28. # The color at the animation start
  29. start_color: Var[str]
  30. class SkeletonText(ChakraComponent):
  31. """SkeletonText is used to display the loading state of some components."""
  32. tag = "SkeletonText"
  33. # The color at the animation end
  34. end_color: Var[str]
  35. # The fadeIn duration in seconds
  36. fade_duration: Var[float]
  37. # If true, it'll render its children with a nice fade transition
  38. is_loaded: Var[bool]
  39. # The animation speed in seconds
  40. speed: Var[float]
  41. # The color at the animation start
  42. start_color: Var[str]
  43. # Number is lines of text.
  44. no_of_lines: Var[int]