mjml.hero

mjml.hero(*args, attributes=None, content=None)

Create an MJML <mj-hero> tag.

Parameters

*args : TagChild = ()

Children (MJMLTag objects)

attributes : Optional[TagAttrs] = None

Optional dict of tag attributes

content : Optional[str] = None

Optional text content for the tag

Returns

: MJMLTag

MJMLTag object representing <mj-hero>

Examples

With children:

from emailer_lib.mjml import hero, text
child = text("Hello World")

result = hero(child)

With attributes:

result = hero(attributes={"attr": "value"})

With both:

result = hero(child, attributes={"background-color": "yellow"})