iconbutton.py 1.0 KB

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