Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyi_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"reflex/components/datadisplay/shiki_code_block.pyi": "ac16fd6c23eef7ce0185437ecf2d529d",
"reflex/components/el/__init__.pyi": "09042a2db5e0637e99b5173430600522",
"reflex/components/el/element.pyi": "323cfb5d67d8ccb58ac36c7cc7641dc3",
"reflex/components/el/elements/__init__.pyi": "280ed457675f3720e34b560a3f617739",
"reflex/components/el/elements/__init__.pyi": "baeddd04d4d3a82799420b2a6df368f6",
"reflex/components/el/elements/base.pyi": "697cd6716e3b1127b35299435c3d4e69",
"reflex/components/el/elements/forms.pyi": "7e067419808bca05125de4967d284935",
"reflex/components/el/elements/inline.pyi": "ab31eec758f1cff8a9d51bf0935b9fca",
"reflex/components/el/elements/media.pyi": "ac99654959ed26b7b7d0f3dafa0ea2ab",
"reflex/components/el/elements/media.pyi": "c191a9e00223a97e26a0d6ab99a1919b",
"reflex/components/el/elements/metadata.pyi": "eda94a3283bae6a9b61b4cb1e20c1dbd",
"reflex/components/el/elements/other.pyi": "960bdac0bb9bf6b3cffd241f9b66c0fc",
"reflex/components/el/elements/scripts.pyi": "ac3b8bfbd7777f33fb2c6aa109a5c627",
Expand Down
1 change: 1 addition & 0 deletions reflex/components/el/elements/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"text",
"line",
"circle",
"g",
"ellipse",
"rect",
"polygon",
Expand Down
26 changes: 26 additions & 0 deletions reflex/components/el/elements/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,30 @@ class Path(BaseHTML):
d: Var[str | int | float]


class G(BaseHTML):
"""The SVG g component, used to group other SVG elements."""

tag = "g"

# The fill color of the group.
fill: Var[str | Color]

# The fill opacity of the group.
fill_opacity: Var[str | int | float]

# The stroke color of the group.
stroke: Var[str | Color]

# The stroke opacity of the group.
stroke_opacity: Var[str | int | float]

# The stroke width of the group.
stroke_width: Var[str | int | float]

# The transform applied to the group.
transform: Var[str]


class SVG(ComponentNamespace):
"""SVG component namespace."""

Expand All @@ -498,6 +522,7 @@ class SVG(ComponentNamespace):
linear_gradient = staticmethod(LinearGradient.create)
radial_gradient = staticmethod(RadialGradient.create)
defs = staticmethod(Defs.create)
g = staticmethod(G.create)
__call__ = staticmethod(Svg.create)


Expand All @@ -512,6 +537,7 @@ class SVG(ComponentNamespace):
linear_gradient = LinearGradient.create
radial_gradient = RadialGradient.create
defs = Defs.create
g = G.create
area = Area.create
audio = Audio.create
image = img = Img.create
Expand Down
6 changes: 6 additions & 0 deletions tests/units/components/el/test_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Circle,
Defs,
Ellipse,
G,
Line,
LinearGradient,
Path,
Expand Down Expand Up @@ -72,3 +73,8 @@ def test_text():
def test_stop():
stop = Stop.create().render()
assert stop["name"] == '"stop"'


def test_g():
g = G.create().render()
assert g["name"] == '"g"'