Skip to content

Reference

Every public name, generated from the source. The import surface is flat:

from svg_plus import Doc, Row, Stack, Text, card

At a glance

Blocks Block Text Span Stack Row Frame Spacer Rule Draw Image Bars and the composites card band heading eyebrow grid
Document and canvas Doc Canvas Rect
Text and line breaking break_paragraph single_line Line
Fonts and themes Font TextStyle Theme load_font builtin_font find_font tint ACCENTS DEFAULT Picture load_image

Conventions

Colour arguments take a #rrggbb literal, "none", one of the palette roles (ink, muted, accent, surface, rule, page) or one of the status colours (red, amber, green, blue, grey). An unknown name raises KeyError.

None on a numeric option means "inherit from the theme". This applies to size, leading, pad, radius and gap.

Every block additionally accepts three keyword-only options from Block:

key Record the block's rectangle under this name, for Doc.connect
grow Absorb a Stack's slack
width Take exactly this many units as a column in a Row

Stack and Row accept grow and width but not key; use .named("x") on them instead.

Coordinates are figure units, with the origin at the top left. Canvas.text takes a baseline, not a top edge.