Shapes: <line>, <rectangle>
<line>
A straight line between two points, (x, y) and (x2, y2).
<line y="65" x2="700" y2="65" width="7" />
- pydantic model todays_paper_web.widgets.core.line.LineParams[source]
Bases:
ViewParams
x/y (shown above via ViewParams, which every widget’s Params inherits — see
Python API reference) do double duty here specifically: they’re both the line’s own start coordinate and
(like on any other widget) the position its parent container places it at, since the rendered image is
cropped tightly to the line’s bounding box starting at that same point — so a diagonal line’s x/y
behaves consistently whether you think of it as “where the line starts” or “where the box places this
element”.
<rectangle>
An outlined or filled rectangle, with optional rounded corners.
<rectangle x="0" y="0" width="{{ width }}" height="70" fill="true" color="#5c5c5c" />
- pydantic model todays_paper_web.widgets.core.rectangle.RectangleParams[source]
Bases:
ViewParams
color accepts a CSS color name or a #hex code; radius/corners behave as on any rounded shape —
radius="0" (the default) draws sharp corners, and corners picks which ones a positive radius rounds
(all, none, top, bottom, left, right, or a comma-separated list of tl/tr/br/bl, e.g.
corners="tl,tr" to round only the top).
Every widget in this reference validates its own attributes (see Python API reference); <line> and
<rectangle> specifically are worth calling out because an unrecognized color or fill value raises a
render error rather than silently falling back to a default.