iconbutton.py 798 B

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