How to make a reusable component with hover effects in Figma

I’m trying to build a component in Figma that I can use over and over again. The component should be a box with text inside it. When someone hovers over the box, I want the background to switch from gray to yellow, but the text should stay exactly the same.

I need to use this same box design multiple times on my page, but each one will have different text content. The hover effect should work the same way for all of them though.

I have two boxes right now with different words in them, and I want to turn this into a reusable component. I tried using the prototyping features but couldn’t get it to work the way I wanted.

Can someone help me figure out how to set this up properly?

for sure! just make 2 variants of ur component, one for gray and one for yellow. keep the text in both the same to allow for easy updates. then use prototype connections to handle the hover effects. this way u can place instances anywhere and change text as needed, super efficient!

To create a reusable component in Figma with hover effects, start by designing your box and adding the text as part of the same component. In the properties panel, include a text property that allows you to customize the text for each instance of the component. Next, duplicate this component to create a variant and change its background color to yellow. In prototype mode, set a mouse enter trigger on the original gray variant to switch to the yellow variant, and a mouse leave trigger on the yellow variant to revert back. After completing these steps, you’ll be able to copy the component throughout your design, customizing the text for each while maintaining the hover effect.

Component properties are clutch for this. Set up your main component with the gray background and add a text property for customizing content later. Here’s what trips people up - you’ve got to organize your layers first before making variants. Name your text layer and background clearly so they’re easy to work with. Build your base component, then duplicate it for the hover variant and just swap the background to yellow. Connect the mouse enter/leave interactions between the two variants. Trust me, I wasted hours debugging broken hover states because I skipped the layer organization step. Once you publish it, every instance keeps the hover behavior but you can still change the text however you want.

Hit this same problem last month building a design system. You need to set up component variants correctly. Start with your base component, then create a variant set with default and hover states. Keep the text properties identical on both variants so you can swap content later. Here’s the catch - set up all your prototyping connections between variants BEFORE publishing to your library. Get your mouse enter/leave interactions working between the gray and yellow states first. Then every instance you create will automatically inherit those behaviors. Test the prototype before you finalize anything. Trust me, fixing interaction bugs after you’ve published components is a nightmare when you’re updating multiple files.