Skip to content

g

The g SVG element is a container used to group other SVG elements.

Transformations applied to the g element are performed on its child elements, and its attributes are inherited by its children. It can also group multiple elements to be referenced later with the use element.

This element only includes global attributes

Usually, this element is created with:

js
const g = parentElement.add('g')

It's possible to create it as a disconnected element with gSVG('g') and attach it to the SVG document with .attachTo().

More info: mdn | w3c

Released under the MIT License.