PackageTrack

npm

@svgdotjs/svg.js

3.2.8svgdotjs/svg.js

A lightweight library for manipulating and animating SVG.

Release timeline

29 releases since 2018
20182026

One column per quarter.

Releases

  1. 3.2.84 Aug 2026

    Nothing published for this version

  2. 3.2.719 Jul 2026

    Nothing published for this version

  3. 3.2.617 Jul 2026
    Release notes

    Changed

    • upgrade svgdom and the development dependencies, including Babel 8
    • migrate builds from Rollup to Rolldown and code-quality checks from ESLint and Prettier to Oxlint and Oxfmt
    • use the standard Browserslist defaults and remove obsolete Sauce Labs tooling

    Fixed

    • preserve namespaces and escaping when serializing SVG in the IE polyfill
    • make the IE outerHTML polyfill replace the target element and reject invalid markup
    • return complete inline styles, including values containing colons and !important
    • allow zero width or height in animated size() calls
    • keep the animator scheduler running after a callback throws
    • honor zero-valued transform positions
    • resolve references safely and match exact targets when IDs contain CSS-special characters
    • preserve multiline text metadata when writing SVG.js data to the DOM
    • align TypeScript declarations with the package's runtime exports and behavior
    • point published browser, ESM, and CommonJS entry points at the built distributions
    • isolate cached parser elements when switching between documents
    • handle document fragments correctly in parents()
    • restore the previous window context when a withWindow() callback throws
    • remove every matching listener when the same callback is registered multiple times
    Open source →
  4. 3.2.515 Sept 2025
    Release notes

    Fixed

    • fixed import of svg strings with leading comment (#1339)
    Open source →
  5. 3.2.427 Jun 2024
    Release notes

    Fixed

    Open source →
  6. 3.2.318 Jun 2024
    Release notes

    Fixed

    • fixed import map for father (#1317)
    Open source →
  7. 3.2.218 Jun 2024
    Release notes

    Fixed

    • fixed import map
    Open source →
  8. 3.2.118 Jun 2024
    Release notes

    Fixed

    • skip descriptive elements on rebuild and toParent() (#1304)
    • allow 0 as animation duration and delay (#1125)
    • allow nodes that are not imported yet (#1252)
    • only apply color conversion to attributes that can take a color (#1241)
    • support css vars (#1230)
    • fix import of leading, dont write data to dom if not neccessary
    • discontinue use of svgjs:data in favor of data-svg
    • allow + as delemiter in paths (#1165)
    • added amove() methods to runner (#1131)
    • fix css(), dont throw when screenCtm fails (#968)
    • several type fixes

    Added

    • add terminate method to timeline so memory can be freed (#1295)
    • add more events to sugar (#1217)
    Open source →
  9. 3.2.012 Jun 2023
    Release notes

    Fixed

    • improve performance of point() by not creating intermediate objects (#1251)
    • fixed references by using single quotes instead of double quotes which lead to errors (#1277)
    • fixed a few spelling errors in comments (#1277)
    • fix several typings (#1253, #1280, #1300)

    Added

    • added second parameter assignNewId to clone() to allow cloning with the same id (#1161)
    Open source →
  10. 3.1.226 Jan 2022
    Release notes

    Fixed

    • fixed several type issues (#1249, #1233, #1231, #1223, #1215)
    • fixed css() returning camelCased properties even though they were specified in kebap-case
    • fixed ObjectBag loosing information when calling valueOf() (Numbers lost its unit)
    • fixed parents() (#1235)
    • fixed nodeOrNew() to work in object tags as well (#1219)
    Open source →
  11. 3.1.125 Jun 2021

    Nothing published for this version

  12. 3.1.013 Jun 2021

    Nothing published for this version

  13. 3.0.1612 Nov 2019
    Release notes2 sources agree

    Fixed

    • fixed build of polyfills which was broken because of core-js update
    Open source →
  14. 3.0.158 Nov 2019
    Release notes2 sources agree

    Fixed

    • allow object input of when and delay to animate()

    Added

    • added missing dmove function to runner
    Open source →
  15. 3.0.1431 Oct 2019
    Release notes2 sources agree

    Fixed

    • hide parser from screen readers (#1023)

    Added

    • added transpiled esm bundle for webpack und co and faster import
    Open source →
  16. 3.0.1312 Jun 2019
    Release notes2 sources agree

    Fixed

    • fixed a bug in Timeline.finish() (#964)
    • fixed registration of classes with custom bundler
    • fixed transform getter (e.g. el.transform('scale'))
    • fixed typings (#1004)
    Open source →
  17. 3.0.1219 Feb 2019
    Release notes2 sources agree

    Fixed

    • fixed package.json which points to correct file for webpack now (browser keyword)
    • fixed typescript types

    Added

    • added ForeignObject to the core
    Open source →
  18. 3.0.1122 Jan 2019
    Release notes2 sources agree

    Fixed

    • fixed move commands (x, y, move) of text so that it moves text always by the upper left edge.
    • fixed center commands (cx, cy, center) of text so that it moves text always by the center.
    Open source →
  19. 3.0.1014 Jan 2019
    Release notes2 sources agree

    Fixed

    • fixed textPath(), path().text() and text().path()
    • fixed root() method
    • fixed default values returned by attr. Can be missleading if present.

    Added

    • added findOne() for better performance
    Open source →
  20. 3.0.914 Jan 2019
    Release notes2 sources agree

    Fixed

    • renamed unit() to convert() due to name collision
    Open source →
  21. 3.0.813 Jan 2019
    Release notes2 sources agree

    Fixed

    • added back to() as unit() of SVG.Number which was removed accidentally
    Open source →
  22. 3.0.713 Jan 2019
    Release notes2 sources agree

    Fixed

    • fixed a bug in isNulledBox() and domContains()
    • performance changes:
      • replace getElementsByTagName with querySelector
      • make Color check in attr more restrictive to prevent expensive toString
    Open source →
  23. 3.0.612 Jan 2019
    Release notes2 sources agree

    Fixed

    • fixed group move and size commands
    • default font size is not set anymore because it mostly goes against what the user wants
    • fix bug in font() which set wrong values

    Added

    • PointArray.transform() (#945)
    Open source →
  24. 3.0.512 Dec 2018
    Release notes2 sources agree

    Fixed

    • fixed parser which didnt have all required css rules and not focusable=false
    • group x(), y(), width(), height(), dx(), dy() now correctly change the bbox of the group by moving/resizing all children
    • fixed timeline which fired finished too early
    • fixed Animator.frame(). The passed callback gets the current time now (same as RAF)
    • allow loop(true) which is the same as loop()
    Open source →
  25. 3.0.47 Dec 2018
    Release notes2 sources agree

    Fixed

    • fixed zoom which was added correctly and is animatable now
    • fixed Runner which merges transformations on the correct frame and in the correct way now
    • fixed condition on which transforms get deleted from an element when animating
    • fixed Timeline which executes Runner in the correct order now
    • fixed Svg which correctly deletes the defs reference on clear()
    Open source →
  26. 3.0.35 Dec 2018
    Release notes2 sources agree

    Fixed

    • fixed Runner which correctly retains transformations when it is still on a timeline
    • fixed plot() method of Runner
    • fixed timeline() so that one can set the timeline of an element now
    • fixed G and added missing width/height
    Open source →
  27. 3.0.23 Dec 2018
    Release notes2 sources agree

    Fixed

    • fixed List which still didn't have all method names it should have
    • fixed Runner which correctly handle retargeted controlled animations now
    • fixed Runner so that it is able to be persisted correctly
    • fixed Color which correctly handles empty strings now
    • fixed attr which correctly handles Objects of other kind now
    • fixed Morphable which correctly calculates the done flag now
    Open source →
  28. 3.0.13 Dec 2018
    Release notes2 sources agree

    Fixed

    • fixed insertBefore, insertAfter and flip correctly returning this
    • fixed List which didn't have all method names it should have
    Open source →
  29. 3.0.01 Dec 2018
    Release notes2 sources agree

    Added

    • added text() method to SVG.Path to create a textPath from this path (#705)
    • added SVG.HTMLNode which is the object wrapped around html nodes to put something in them
    • added dispatch() method on SVG.Element which returns the dispatched event for event cancelation (#550)
    • added isRoot() on SVG.Doc (#809)
    • added a linter during the npm build process
    • added beziere() and steps() to generate easing functions
    • added insertAfter() and insertBefore
    • added SVG.Style which can be created with style() or fontface() (#517)
    • added EventTarget which is a baseclass to get event abilities (#641)
    • added Dom which is a baseclass to get dom abilities
    • added round() which lets you round attribues from a node
    • added ax(), ay(), amove() to change texts x and y values directly (#787)
    • added possibility to pass attributes into a constructor like: new SVG.Rect({width:100})
    • added possibility to pass in additional attribues to element creators e.g. canvas.rect({x:100}) or canvas.rect(100, 100, {x:100}) (#796)
    • added SVG.List (#645)
    • added words() and element() to Dom because of (#935)
    • added lab, lch, hsl and cmyk color spaces (#790)
    • added random() method on SVG.Color to create random colors of different kinds (#939)

    Removed

    • removed SVG.Array.split() function
    • removed workaround for browser bug with stroke-width
    • removed polyfills
    • removed SVG.Set in favour of SVG.List
    • removed feature to set style with css string (e.g. "fill:none;display:block;")
    • removed loaded() and error() method on SVG.Image (#706)
    • removed sub-pixel offset fix
    • removed SVG.Nested (#809)
    • removed show() from SVG.A to avoid name clash (#802)
    • removed size() from SVG.Text to avoid name clash (#799)
    • removed native() function
    • removed Bare in favour of Dom (#935)
    • removed bower support because it is deprecated

    Changed

    • gradients now have there corresponding node as type and not only radial/linear
    • SVG.Path.pointAt() correctly returns an SVG.Point now
    • replaced static reference to masker in SVG.Mask with the masker() method
    • replaced static reference to clipper in SVG.ClipPath with the clipper() method
    • replaced static reference to targets in SVG.Mask and SVG.ClipPath with the targets() method
    • moved all regexes to SVG.regex
    • new constructor signature for SVG.Image and load(): container.image(src, callback) / image.load(src, callback) (#706)
    • changed style() to css(). Now accepts array as input and returns object when no argument given (#517)
    • ids are not generated upon creation anymore. Instead they are generated when requested (#559)
    • SVG.extend() now expects exactly one module or an array of modules
    • SVG.Text.path() now returns an instance of SVG.TextPath (#705)
    • SVG.Text.path() does not move all contents to the textPath (#705)
    • SVG.TextPath now inherits from SVG.Text and can be manipulated the same way (#705)
    • SVG.Text.textPath() returns the first textPaths in the text element (#705)
    • renamed SVG.Stop constructor at() on SVG.Gradient to stop() (#707)
    • renamed fill() method on SVG.Gradient and SVG.Pattern to url() (#708)
    • renamed previous() method to prev()
    • changed childNodes to children (same for firstChild, lastChild, ...) (#710) - changed it back because of performance drop
    • moved defs() method from SVG.Parent to SVG.Element
    • SVG() can be called with css selector, node or svg string, now. Without an argument it creates a new SVG.Doc() (#646)
    • add(), put(), addTo(), putIn() now excepts all arguments accepted by SVG()
    • all SVG.* objects now can have a node as parameter when constructing
    • SVG() does not set a default size anymore
    • default constructor now has an optional node argument which is used to consruct the object e.g. new SVG.Rect(rectNode)
    • SVG.Elements constructor now tries to import svgjs:data from the node
    • SVG.on() calls the listener in the context of the passed object. el.on always uses the svg.js object as context
    • SVG.on()/off() and el.on()/off() now accepts multiple comma or space separated events e.g. "mousedown, foo bar" (#727)
    • Matrices now apply transformations like scale, translate, etc... by left multiplying them to simplify transformations
    • The way transform() works is now completely different. See the docs for more as soon as they are updated
    • merged SVG.Doc and SVG.Nested, added isRoot() on SVG.Doc() (#809)
    • The fx module was completely reworked to be faster and less error prone. For more information on how to use it refer to the docs
    • The whole lib is now splitted into es6 modules (#875)
    • Element.svg() now can can replace the current node, can export the children of a node and can take an export modifier to change/replace the exported nodes
    • ungroup() now breaks off one container and not more
    • clone() does not add the clone to the dom anymore
    • attr() excepts array now to get multiple values at once
    • SVG.Text.rebuild() now takes every font-size into account (#512)
    • fill() and stroke() return the fill and stroke attribute when called as getter (#789)
    • parents() now gives back all parents until the passed one or document
    • Image callback passes normal load event instead of custom object (#931)
    • renamed Doc to Svg and doc() to root (and toDoc()/toRoot()) (#932)
    Open source →