Repository navigation
v1.4.0
Add support for dataclass components:
from dataclasses import dataclass
from markupy import Component, View, tag
@dataclass
class Title(Component):
id: str
def render(self) -> View:
return tag.H1(".title.header", id=self.id)[self.render_content()]And then:
>>> print(Title(id="headline")["hello "])This will render as:
<h1 class="title header" id="headline">
hello
</h1>