lusaxweb / Kursor

Cursor style with javascript and css
https://lusaxweb.github.io/Kursor/
MIT License
173 stars 100 forks source link

How can I use it on NextJS? #16

Closed hanancs closed 3 years ago

hanancs commented 3 years ago

I kept trying use it using next/script and other available methods, I couldn't figure it out. 🤔

hanancs commented 3 years ago

According to NextJS documentation : Next Script

All you gotta do is,

<script dangerouslySetInnerHTML={{ __html: `new kursor({
            type: 1
        })` }} />

This works perfectly both in dev and prod...

hanancs commented 3 years ago

Don't forget to add following code into Head tag

<link rel="stylesheet" href="https://unpkg.com/kursor/dist/kursor.css" />
<script src="https://cdn.jsdelivr.net/npm/kursor"></script>