nextlink.py 569 B

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