Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use svg image in next js

import Image from 'next/img';

import Illustration from '../public/Rolling-1s-200px.svg';
// can be imported from anywhere, not necessarily public

// ...

<Image src={Illustration} />
// one needs to use `Illustration.src` to get the source URL
// <img src={Illustration.src} ... />
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #svg #image #js
ADD COMMENT
Topic
Name
2+1 =