Aleks Profile picture
staff product designer

Feb 6, 2023, 12 tweets

Framer February β†’ Day 5 ✨

A super quick way to create a gradient cursor highlighter in @framer. Let's get started ↓

πŸ₯Ή As always, begin by drawing a frame (F)

Next, add a fill (𝘢𝘴𝘦 π˜₯𝘒𝘳𝘬𝘦𝘳 𝘀𝘰𝘭𝘰𝘳𝘴 𝘰𝘯 π˜₯𝘒𝘳𝘬 𝘣𝘒𝘀𝘬𝘨𝘳𝘰𝘢𝘯π˜₯𝘴, 𝘒𝘯π˜₯ 𝘭π˜ͺ𝘨𝘩𝘡𝘦𝘳 𝘀𝘰𝘭𝘰𝘳𝘴 𝘰𝘯 𝘭π˜ͺ𝘨𝘩𝘡 𝘣𝘒𝘀𝘬𝘨𝘳𝘰𝘢𝘯π˜₯𝘴)

β€’ Add a corner radius (if you want...)
β€’ Add a border (use a width of 1-3px)

Now, select your frame and create a component (⌘ + βŒ₯ + K)

✨ We'll need a little bit of code for the next step. Head on over here, and copy everything you see β†’ pastebin.com/GZpHzA6n

Now, it's time to add an override to the component. With the primary variant selected, go to:

β€’ Code Overrides β†’ New File β†’ New Override
β€’ Name it whatever you want, and replace the default with the code you copied in the previous step ↓

Let's apply the newly created override. Select the primary variant and link the override you added earlier↓

If you preview your creation now, you'll notice that the highlight is working, but it's not quite aligned with your cursor 😰

To fix this, add a stack ( βŒ₯ + ⌘ + ↡ ), and set it to 100% width & height. At this point, you're pretty much done πŸ₯³

But, if you'd like to get rid of the cursor on hover, keep up ↓

In the component settings, select the primary variant, and:

β€’ Under styles hit the β€œ + β€œ
β€’ Select "Cursor," and set it to "None"

πŸ‘† You can, of course, edit the colors of your cursor highlighter by changing the rgb values for the "backgroundImage" propery of the "Highlight" function in the code override.

✨ That's it! Congrats, you have a pretty awesome card that adds a gradient highlight to your cursor. If you found this tutorial useful, please RT to share the love 🫢

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling