link.py 477 B

123456789101112131415161718192021
  1. """Display the title of the current page."""
  2. from pynecone.components.component import Component
  3. from pynecone.components.tags import Tag
  4. from pynecone.var import Var
  5. class Link(Component):
  6. """A component that displays the title of the current page."""
  7. # The href.
  8. href: Var[str]
  9. # The type of link.
  10. rel: Var[str]
  11. def _render(self) -> Tag:
  12. return Tag(name="link").add_attrs(
  13. href=self.href,
  14. rel=self.rel,
  15. )