iconbutton.py 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. """An icon button component."""
  2. from typing import Optional
  3. from reflex.components.component import Component
  4. from reflex.components.typography.text import Text
  5. from reflex.vars import Var
  6. class IconButton(Text):
  7. """A button with an icon."""
  8. tag = "IconButton"
  9. # The type of button.
  10. type: Var[str]
  11. # A label that describes the button
  12. aria_label: Var[str]
  13. # The icon to be used in the button.
  14. icon: Optional[Component]
  15. # If true, the button will be styled in its active state.
  16. is_active: Var[bool]
  17. # If true, the button will be disabled.
  18. is_disabled: Var[bool]
  19. # If true, the button will show a spinner.
  20. is_loading: Var[bool]
  21. # If true, the button will be perfectly round. Else, it'll be slightly round
  22. is_round: Var[bool]
  23. # Replace the spinner component when isLoading is set to true
  24. spinner: Var[str]