link.py 416 B

123456789101112131415
  1. import justpy as jp
  2. from typing import List
  3. from .element import Element
  4. class Link(Element):
  5. def __init__(self, text: str = '', href: str = '#', typography: List[str] = []):
  6. if isinstance(typography, str):
  7. typography = [typography]
  8. classes = ' '.join('text-' + t for t in typography)
  9. view = jp.A(text=text, href=href, classes=classes)
  10. super().__init__(view, '')