Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

pass props to svg

<svg width="160" viewBox="0 0 160 120">
    <defs>
        <g id="test">
            <rect width="60" height="40"/>
        </g>
    </defs>
    
    <g transform="translate(0,20)">
        <use href="#test" fill="aqua" stroke="blue" />
        <text x="10" y="25">Name</text>
    </g>
    <g transform="translate(80,20)">
        <use href="#test" fill="orange" stroke="red" />
        <text x="10" y="25">{props.text}</text>
    </g>
    
    <text y="100">This space for rent</text>
</svg>
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Javascript :: react clearinterval outside of useefect 
Javascript :: format file using jq 
Javascript :: image opacity reduce js 
Javascript :: populating selectfield from json file 
Javascript :: check string length pixel "react" 
Javascript :: find a node that match a spesific selector string in the paren 
Javascript :: fcus on element 
Javascript :: mm2javascript 
Javascript :: replace div content javascript 
Javascript :: Create an Array of specific length with some value at each index 
Javascript :: delayed usestate double click 
Javascript :: How do you convert VARCHAR to TIMESTAMP 
Javascript :: jshack1 
Javascript :: group by hash in jquery 
Javascript :: calculations inside a render function react js 
Javascript :: event module 
Javascript :: javascript get token from query string 
Javascript :: javascript display block div 
Javascript :: return axios response from seperate file 
Javascript :: how remove prperty or object in javscript 
Javascript :: atomic design with redux 
Javascript :: Spread Syntax for array literals or strings 
Javascript :: updater function 
Javascript :: var quotes 
Javascript :: history go back js oneline 
Javascript :: how to check if jquery element is loaded 
Javascript :: react native parent opcaity not affecting text 
Javascript :: please run 
Javascript :: vue2-editor save image 
Javascript :: js unslick 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =