Skip to content

SVG Tags T-Z

Air is proud to provide first class SVG support. The entire SVG specification is supported.

Text

Text(
    *children,
    x=None,
    y=None,
    dx=None,
    dy=None,
    rotate=None,
    lengthAdjust=None,
    textLength=None,
    class_=None,
    id=None,
    style=None,
    **kwargs,
)

Bases: CaseTag

Defines text content

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
x str | float | None

X-coordinates of text baseline.

None
y str | float | None

Y-coordinates of text baseline.

None
dx str | float | None

Horizontal shift from previous text.

None
dy str | float | None

Vertical shift from previous text.

None
rotate str | None

Rotation of individual glyphs.

None
lengthAdjust str | None

Text stretching method.

None
textLength str | float | None

Target width for text scaling.

None
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
def __init__(
    self,
    *children: Renderable,
    x: str | float | None = None,
    y: str | float | None = None,
    dx: str | float | None = None,
    dy: str | float | None = None,
    rotate: str | None = None,
    lengthAdjust: str | None = None,
    textLength: str | float | None = None,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))

TextPath

TextPath(
    *children,
    href=None,
    lengthAdjust=None,
    method=None,
    path=None,
    side=None,
    spacing=None,
    startOffset=None,
    textLength=None,
    class_=None,
    id=None,
    style=None,
    **kwargs,
)

Bases: CaseTag

Defines text along a path

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
href str | None

Reference to path element for text layout.

None
lengthAdjust str | None

Length adjustment method.

None
method str | None

Glyph rendering method.

None
path str | None

Path data for text layout.

None
side str | None

Which side of path to render text.

None
spacing str | None

Glyph spacing handling.

None
startOffset str | float | None

Offset from path beginning.

None
textLength str | float | None

Text rendering width.

None
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
def __init__(
    self,
    *children: Renderable,
    href: str | None = None,
    lengthAdjust: str | None = None,
    method: str | None = None,
    path: str | None = None,
    side: str | None = None,
    spacing: str | None = None,
    startOffset: str | float | None = None,
    textLength: str | float | None = None,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))

Title

Title(
    *children, class_=None, id=None, style=None, **kwargs
)

Bases: CaseTag

Defines a title for the SVG document

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1906
1907
1908
1909
1910
1911
1912
1913
1914
def __init__(
    self,
    *children: Renderable,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))

Tspan

Tspan(
    *children,
    x=None,
    y=None,
    dx=None,
    dy=None,
    rotate=None,
    lengthAdjust=None,
    textLength=None,
    class_=None,
    id=None,
    style=None,
    **kwargs,
)

Bases: CaseTag

Defines a text span

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
x str | float | None

X-coordinates of text baseline.

None
y str | float | None

Y-coordinates of text baseline.

None
dx str | float | None

Horizontal shift from previous text.

None
dy str | float | None

Vertical shift from previous text.

None
rotate str | None

Rotation of individual glyphs.

None
lengthAdjust str | None

Text stretching method.

None
textLength str | float | None

Target width for text scaling.

None
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
def __init__(
    self,
    *children: Renderable,
    x: str | float | None = None,
    y: str | float | None = None,
    dx: str | float | None = None,
    dy: str | float | None = None,
    rotate: str | None = None,
    lengthAdjust: str | None = None,
    textLength: str | float | None = None,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))

Use

Use(
    *children,
    href=None,
    x=None,
    y=None,
    width=None,
    height=None,
    class_=None,
    id=None,
    style=None,
    **kwargs,
)

Bases: CaseTag

References another element

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
href str | None

Reference to element to duplicate.

None
x str | float | None

X offset transformation.

None
y str | float | None

Y offset transformation.

None
width str | float | None

Width (only for elements with viewBox).

None
height str | float | None

Height (only for elements with viewBox).

None
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
def __init__(
    self,
    *children: Renderable,
    href: str | None = None,
    x: str | float | None = None,
    y: str | float | None = None,
    width: str | float | None = None,
    height: str | float | None = None,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))

View

View(
    *children,
    viewBox=None,
    preserveAspectRatio=None,
    class_=None,
    id=None,
    style=None,
    **kwargs,
)

Bases: CaseTag

Defines a view

Parameters:

Name Type Description Default
children Renderable

Tags, strings, or other rendered content.

()
viewBox str | None

Viewport bounds.

None
preserveAspectRatio str | None

Aspect ratio handling.

None
class_ str | None

Substituted as the DOM class attribute.

None
id str | None

DOM ID attribute.

None
style str | None

Inline style attribute.

None
**kwargs AttributeType

Additional attributes.

{}
Source code in src/air/tags/models/svg.py
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
def __init__(
    self,
    *children: Renderable,
    viewBox: str | None = None,
    preserveAspectRatio: str | None = None,
    class_: str | None = None,
    id: str | None = None,
    style: str | None = None,
    **kwargs: AttributeType,
) -> None:
    super().__init__(*children, **kwargs | locals_cleanup(locals()))