Skip to main content

Function: svgCursor()

svgCursor(path, hotspot, fallback): string

Defined in: src/lib/rendering/cursors/index.ts:10

Build a CSS cursor from SVG path data drawn on a 24×24 grid: black lines with a white outline so it shows on any colour.

Parameters​

path​

string

hotspot​

[number, number]

the point (in the 24×24 grid) that is the cursor's exact position

fallback​

string

standard cursor used if the image cannot be shown

Returns​

string

Example​

svgCursor("M4 4 L20 20", [4, 4], "crosshair"); // 'url("data:image/svg+xml,...") 4 4, crosshair'