Easy Using SVG on NextJS Typescript
Ariska Hidayat
1 min read
Simple use svg on NextJS. this recommendation from me. you can use file svg on the public folder. but, you have difficulty changing color.
Convert image to svg using https://convertio.co/
step-step to use svg on NextJs:
- make file Icon.tsx
export default function Icon() {
return (
// svg value
)
change properties from kebab-case to camelCase
change color to dynamic color
fill="currentColor"
- import icon
import Icon from '@/icons/Icon';
- use/implementation icon
<Icon/>
I hope this article is useful. thank
0
Subscribe to my newsletter
Read articles from Ariska Hidayat directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Ariska Hidayat
Ariska Hidayat
I am an enthusiastic researcher and developer with a passion for using technology to innovate in business and education.