CSS.paintWorklet (Static property)

Draft: This page is not complete.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

paintWorklet is a static, read-only property of the CSS interface that provides access to the PaintWorklet, which programmatically generates an image where a CSS property expects a file.


var worklet = CSS.paintWorklet;


The PaintWorklet object.


The following example demonstrates loading a PaintWorklet from its js file and does so by feature detection.

  if ('paintWorklet' in CSS) {


CSS Painting API Level 1 (CSS Painting API 1)
# ref-for-dom-css-paintworklet

Browser compatibility

BCD tables only load in the browser

See also