UNPKG

zextra

Version:

***Zextra*** stands for "Ziko Extra" is an extension package that enhances [ZikoJS](https://github.com/zakarialaoui10/ziko.js) by providing additional utilities and UI elements. It expands ZikoJS with extra features, making it easier to work with custom U

29 lines 658 B
import ZikoSvgElement from "../ZikoSvgElement.js"; class ZikoSvgText extends ZikoSvgElement{ constructor(text,x,y){ super() this.element=document?.createElementNS( "http://www.w3.org/2000/svg", "text", ); this.setText(text) this.x(x).y(y); } x(x){ this.element?.setAttribute("x",x); return this; } y(y){ this.element?.setAttribute("y",y); return this; } setText(text=""){ this.element.textContent=text; return this; } } const svgText=(text,x,y)=>new ZikoSvgText(text,x,y); export{ svgText, ZikoSvgText }