A guide to component logic

There is a dangerous myth in our industry that "Handoff" is the moment you throw a Figma link over the wall and pray.
You spend weeks perfecting the pixels. You align everything to the grid. Then the developers builds it, and you stare at the screen in horror. The padding is wrong. The font-size is weird. The button doesn't do that cool swish-whoosh thing you imagined in your head.
It's easy to blame the engineer. But let's be real : If you handoff a flat image and expect a fully functional, responsive component, you don't want a developer. You want a psychic.
Developers aren't photocopiers. They are logic engines. If you don't give them the logic, they have to guess. And when developers guess, they guess for speed, not aesthetics.
Here is how to stop drawing pictures and start designing software.
Junior designers design what the component looks like. Senior design design how it behaves.
In Figma, a button is just a rectangle with text. In code, a button is a living thing with about five different personalities. If you only design the "Default" state, you have done 20% of the work.
You need to explicitly define :
Hover : Does it lift? Darken? (And remember, mobile users don't have hover, so don't hide critical info here).
Pressed : The "clicky" feel.
Disabled : And don't just lower the opacity to 50%. That ruins contrast and makes it unreadable.
Focus : This is a big one.
If you remove the browser’s default blue outline because "it’s ugly," you have broken the internet for keyboard users. You need to design a
:focus-visible state. It doesn't have to be ugly, but it has to be high-contrast. If a user can’t tab through your form without a mouse, that’s not a dev bug. That’s a design bug.
I once saw a designer handoff a card component that was exactly 345px wide.
"Why 345?" the developer asked.
"Because that's how it fits in the grid," the designer said.
This is a crime.
The web is fluid. Phones rotate. Browsers resize. Users zoom in to 200%. If you design with fixed pixel widths, your layout will shatter the moment reality hits it.
Stop thinking in pixels and start thinking in relationships. Don't say : "This card is 300px wide." Say : "This card fills 100% of the container, up to max-width of 400px."
This is how developers think - Flexbox and Grid. If you speak their language - constraints, growth ratios, and wrapping behavior, they will love you. If you give them fixed numbers, they will secretly hate you while they write media queries to fix your mess.
Open your layers panel. Look me in the eye.
If I see Frame 1, Group 45, and Rectangle 8, we are going to have a problem.
You might think layer names don't matter because they don't show up in the final product. You are wrong. The developer looks at your layer tree to understand the structure of the code.
If you name a layer Card_Header, the developer will probably create a class called .card-header.
If you leave it as Frame 12, the developer will name it .wrapper-div-thingy, and six months from now, nobody will know what that code does.
Naming is the first step of coding. Do it in Figma so they don't have to invent it in VS Code.
If you are still manually picking #3B82F6 for every blue button, you are creating "Technical Debt."
What happens when the brand team decides to change the primary blue to #2563EB? You have to hunt down every instance in 50 files. The developer has to Find/Replace across the entire codebase.
Use Design Tokens.
Define variables like color-primary-500 or spacing-md.
When you handoff a design, don't tell the dev "Make this margin 16px." Tell them "Use spacing-md." It ensures consistency. It means that if you update the token library, the entire app updates automatically. It turns your design system from a sticker sheet into a source of truth.
The gap between Design and Engineering is usually just a lack of documentation.
Your job isn't to make the Figma file look pretty. Your job is to make the production code look pretty. And the only way to do that is to stop treating the developer like a machine that converts pixels to code, and start treating them like a partner who needs the blueprint, not just the rendering.
0
4
0