link.py 549 B

12345678910111213141516171819202122
  1. """A link component."""
  2. from typing import Optional
  3. from reflex.components.component import Component
  4. from reflex.vars import Var
  5. class NextLink(Component):
  6. """Links are accessible elements used primarily for navigation. This component is styled to resemble a hyperlink and semantically renders an <a>."""
  7. library = "next/link"
  8. tag = "NextLink"
  9. is_default = True
  10. # The page to link to.
  11. href: Optional[Var[str]] = None
  12. # Whether to pass the href prop to the child.
  13. pass_href: Var[bool] = True # type: ignore