1
0

copytoclipboard.py 574 B

12345678910111213141516171819202122232425
  1. """A copy to clipboard component."""
  2. from typing import Set
  3. from reflex.components import Component
  4. from reflex.vars import Var
  5. class CopyToClipboard(Component):
  6. """Component to copy text to clipboard."""
  7. library = "react-copy-to-clipboard"
  8. tag = "CopyToClipboard"
  9. # The text to copy when clicked.
  10. text: Var[str]
  11. def get_controlled_triggers(self) -> Set[str]:
  12. """Get the event triggers that pass the component's value to the handler.
  13. Returns:
  14. The controlled event triggers.
  15. """
  16. return {"on_copy"}