<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oguz</title>
    <description>The latest articles on DEV Community by Oguz (@ouzozcn).</description>
    <link>https://dev.to/ouzozcn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3388025%2F5f755e5b-2137-4c22-9ee0-edf2aff83e66.png</url>
      <title>DEV Community: Oguz</title>
      <link>https://dev.to/ouzozcn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ouzozcn"/>
    <language>en</language>
    <item>
      <title>Component Design for JavaScript Frameworks</title>
      <dc:creator>Oguz</dc:creator>
      <pubDate>Tue, 17 Mar 2026 13:58:38 +0000</pubDate>
      <link>https://dev.to/ouzozcn/component-design-for-javascript-frameworks-2pmf</link>
      <guid>https://dev.to/ouzozcn/component-design-for-javascript-frameworks-2pmf</guid>
      <description>&lt;p&gt;You have seen it before. A Figma file lands in your lap with frames named &lt;code&gt;Group 47&lt;/code&gt;, colors hard-coded as &lt;code&gt;#3A2FBC&lt;/code&gt;, and zero indication of which states actually exist. You reverse-engineer the design, fill in the gaps, and ship something that mostly resembles what was intended. This is not a workflow problem. It is a communication problem. And it is one designers can fix on their side of the fence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://o10n.design/articles/component-design-for-javascript-frameworks?utm_source=dev-to&amp;amp;utm_medium=article&amp;amp;utm_campaign=blog&amp;amp;utm_id=261005" rel="noopener noreferrer"&gt;This article&lt;/a&gt; is written for both sides of that handoff. If you are a developer tired of ambiguous specs, here is what well-structured components actually look like. If you are a designer reading this on dev.to because you want to close that gap, welcome. You are already ahead. It covers four fundamentals: &lt;strong&gt;Structure&lt;/strong&gt;, &lt;strong&gt;Properties&lt;/strong&gt;, &lt;strong&gt;Tokens&lt;/strong&gt;, and &lt;strong&gt;Interactions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's begin if you're prepared to explore!&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Structure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5orxoixbqvfdne3vpje8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5orxoixbqvfdne3vpje8.png" alt="Layer Layout Example on Figma UI" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every frame in Figma corresponds to an HTML element. When you nest frames to build a component, you are essentially defining the HTML structure. This is why it matters deeply how you organize and name your layers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frames over Groups.&lt;/strong&gt; Figma offers two grouping methods: Groups and Frames. Use Frames. Only Frames unlock Auto-Layout, which maps directly to CSS Flexbox. When you configure Auto-Layout in Figma, you are defining &lt;code&gt;display: flex&lt;/code&gt;, &lt;code&gt;flex-direction&lt;/code&gt;, &lt;code&gt;justify-content&lt;/code&gt;, &lt;code&gt;align-items&lt;/code&gt;, &lt;code&gt;gap&lt;/code&gt;, and &lt;code&gt;padding&lt;/code&gt; simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name your layers meaningfully.&lt;/strong&gt; A layer named &lt;code&gt;CardTitle&lt;/code&gt; is far more useful to a developer than &lt;code&gt;Text_Layer_2&lt;/code&gt;. Descriptive names communicate semantic purpose, inform CSS class naming, and reduce the need for developer clarifications during handoff.&lt;/p&gt;

&lt;p&gt;Good layer naming:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CardImage
CardTitle
ActionButton
IconWrapper
PriceLabel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Container
Wrapper
Group
Frame #123456
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key principle:&lt;/strong&gt; Use the minimum number of frames necessary to achieve the layout. Each frame adds a DOM element. Fewer frames mean cleaner, more maintainable code.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Properties
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zpwno0f2nhvmlotzt33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zpwno0f2nhvmlotzt33.png" alt="Component Properties in Figma UI" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Component properties are arguably Figma's most powerful feature for creating flexible, developer-friendly components. Every reusable element I design gets a set of well-defined properties. It is a time investment that pays off significantly during development.&lt;/p&gt;

&lt;p&gt;Figma supports four property types that map directly to JavaScript equivalents:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Figma Property&lt;/th&gt;
&lt;th&gt;Frontend Equivalent&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Button label, card title&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;isDisabled, isLoading&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance Swap&lt;/td&gt;
&lt;td&gt;Component instance&lt;/td&gt;
&lt;td&gt;Icon, avatar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Variant&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;string&lt;/code&gt; enum&lt;/td&gt;
&lt;td&gt;type="primary", size="large"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Naming conventions matter.&lt;/strong&gt; Adopting front-end conventions in your property naming reduces the cognitive gap between design and development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;camelCase&lt;/code&gt; (e.g., &lt;code&gt;buttonLabel&lt;/code&gt;, &lt;code&gt;isDisabled&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Prefix booleans with &lt;code&gt;is&lt;/code&gt;, &lt;code&gt;has&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, or &lt;code&gt;can&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;?&lt;/code&gt; to indicate optional properties (e.g., &lt;code&gt;startIcon?&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Avoid generic names like &lt;code&gt;text1&lt;/code&gt;, &lt;code&gt;icon&lt;/code&gt;, or &lt;code&gt;end&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When your Figma properties mirror the TypeScript interface a developer will write, handoff becomes nearly frictionless. The same &lt;code&gt;label&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;isDisabled&lt;/code&gt;, and &lt;code&gt;isLoading&lt;/code&gt; properties work identically across React, Vue, Angular, and Svelte with only minor syntax differences.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Tokens
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjhw7ntx7zm8vjuwhvth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjhw7ntx7zm8vjuwhvth.png" alt="Design Tokens in Figma UI" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hard-coded values like &lt;code&gt;#0D99FF&lt;/code&gt; or &lt;code&gt;16px&lt;/code&gt; create maintenance debt. Design tokens replace those values with named variables, such as &lt;code&gt;--color-primary-600&lt;/code&gt; or &lt;code&gt;--spacing-4&lt;/code&gt;, that resolve to specific values depending on context (light mode, dark mode, high contrast).&lt;/p&gt;

&lt;p&gt;Tokens operate across three levels of abstraction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Primitive tokens:&lt;/strong&gt; Base values like &lt;code&gt;--amber-500&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Component tokens:&lt;/strong&gt; Element-specific like &lt;code&gt;--button-surface-primary&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application tokens:&lt;/strong&gt; Theme-level like &lt;code&gt;--system-theme-primary&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In Figma&lt;/strong&gt;, tokens are managed through the Variables feature using four types: Color, Number, String, and Boolean. Once defined, you can apply them to any fill, stroke, spacing, or dimension property across your entire design system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The payoff is significant.&lt;/strong&gt; When a brand color changes, updating one token updates it everywhere. When a stakeholder asks for a dark mode, you have the infrastructure to deliver it without rebuilding components from scratch. Tokens also help manage accessibility compliance by making it easier to track and adjust contrast ratios systematically.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Interactions
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3xl38utyjoidd550e7gf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3xl38utyjoidd550e7gf.png" alt="Prototyping in Figma UI" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A static component tells half the story. Prototyping interactions in Figma adds crucial context for developers and stakeholders alike.&lt;/p&gt;

&lt;p&gt;Every interactive component should define these core states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Default:&lt;/strong&gt; The resting appearance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hover:&lt;/strong&gt; Visual feedback on pointer over&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focus:&lt;/strong&gt; Keyboard navigation indicator (critical for WCAG compliance)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active/Pressed:&lt;/strong&gt; Feedback during click or tap&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disabled:&lt;/strong&gt; Non-interactive, reduced opacity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loading:&lt;/strong&gt; Indicates an async operation in progress&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error:&lt;/strong&gt; Validation failure feedback&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Success:&lt;/strong&gt; Confirmation of a completed action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Triggers and Actions in Figma&lt;/strong&gt; allow you to configure how a component responds to user input. The most common triggers are On Click and While Hovering. For mobile, On Tap and On Drag take priority.&lt;/p&gt;

&lt;p&gt;Beyond individual components, interactions map your user flows. Configuring an On Click event on a button in Figma to navigate to a destination is the same decision a developer makes when writing an &lt;code&gt;onClick&lt;/code&gt; handler. This shared vocabulary closes the gap between disciplines.&lt;/p&gt;

&lt;p&gt;When interactions are defined in Figma, developers can inspect them directly via Dev Mode, VS Code, or Cursor. It also helps catch design faults early and makes usability testing more meaningful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bringing It Together
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7omgbpcmhcm7b5t1iwap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7omgbpcmhcm7b5t1iwap.png" alt="The Basics of a Component From Design to Development" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These four fundamentals are not isolated techniques. They work together to create a component that is easy to implement, easy to maintain, and easy to scale.&lt;/p&gt;

&lt;p&gt;When you structure frames with HTML in mind, name properties using front-end conventions, implement design tokens for scalable theming, and prototype complete interaction states, you are not just creating better Figma files. You are building bridges between disciplines.&lt;/p&gt;

&lt;p&gt;The practical benefits show up quickly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fewer clarification questions from developers&lt;/li&gt;
&lt;li&gt;Faster feature delivery&lt;/li&gt;
&lt;li&gt;Better code quality from the start&lt;/li&gt;
&lt;li&gt;Lower technical debt over time&lt;/li&gt;
&lt;li&gt;More scalable design systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best components are not just visually polished. They are thoughtfully structured, clearly documented, and ready to become excellent in production.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thank you for reading this article. If you are interested in creating components that translates to code, read the full article with interactive examples, code snippets, and diagrams at &lt;a href="https://o10n.design/articles/component-design-for-javascript-frameworks?utm_source=dev-to&amp;amp;utm_medium=article&amp;amp;utm_campaign=blog&amp;amp;utm_id=261005" rel="noopener noreferrer"&gt;o10n.design&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>design</category>
      <category>resources</category>
    </item>
  </channel>
</rss>
