<?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: Allan Carlos</title>
    <description>The latest articles on DEV Community by Allan Carlos (@thisisallan).</description>
    <link>https://dev.to/thisisallan</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%2F728616%2F98f7a3a9-28de-4361-8e01-85c8e879981d.png</url>
      <title>DEV Community: Allan Carlos</title>
      <link>https://dev.to/thisisallan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thisisallan"/>
    <language>en</language>
    <item>
      <title>Chrome Extension: Capture &amp; Generate Components with AI</title>
      <dc:creator>Allan Carlos</dc:creator>
      <pubDate>Sun, 09 Mar 2025 19:26:08 +0000</pubDate>
      <link>https://dev.to/thisisallan/element-screenshot-chrome-extension-capture-generate-components-with-ai-4n4m</link>
      <guid>https://dev.to/thisisallan/element-screenshot-chrome-extension-capture-generate-components-with-ai-4n4m</guid>
      <description>&lt;h2&gt;
  
  
  📸 Component Capture - Chrome Extension
&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%2Fy66m7o8gdmz9zmde23n9.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%2Fy66m7o8gdmz9zmde23n9.png" alt="Image description" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Easily capture individual web elements with a simple hover and click! 🚀  &lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Highlight Elements:&lt;/strong&gt; Hover over any web component to see a red border.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-Click Screenshot:&lt;/strong&gt; Click to capture only the selected element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto Copy to Clipboard:&lt;/strong&gt; The screenshot is instantly copied for easy sharing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Component Generation:&lt;/strong&gt; Generate React components from your screenshots using OpenAI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Component Types:&lt;/strong&gt; Choose between React, React + Tailwind, or React + Styled Components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight &amp;amp; Fast:&lt;/strong&gt; Works seamlessly on any website.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ideal for Developers, Designers &amp;amp; Testers!&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📥 Installation
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download the Source Code:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone git@github.com:this-is-allan/component-screenshot.git
   &lt;span class="nb"&gt;cd &lt;/span&gt;component-screenshot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Load the Extension in Chrome:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Chrome and go to chrome://extensions/.&lt;/li&gt;
&lt;li&gt;Enable Developer Mode (top right).&lt;/li&gt;
&lt;li&gt;Click Load unpacked and select the project folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start Capturing Screenshots!&lt;/strong&gt; 🎉&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🚀 How to Use
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Capturing Screenshots
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click on the Element Screenshot extension icon in the toolbar.&lt;/li&gt;
&lt;li&gt;Activate Scan Mode from the popup.&lt;/li&gt;
&lt;li&gt;Hover over any element – it will be highlighted with a red border.&lt;/li&gt;
&lt;li&gt;Click on the element to take a screenshot.&lt;/li&gt;
&lt;li&gt;The image is automatically copied to the clipboard!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Generating React Components
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Capture a screenshot of a UI element.&lt;/li&gt;
&lt;li&gt;In the extension popup, click "Select" on the screenshot you want to use.&lt;/li&gt;
&lt;li&gt;Enter your OpenAI API key (required only once).&lt;/li&gt;
&lt;li&gt;Choose the component type (React, React + Tailwind, React + Styled Components).&lt;/li&gt;
&lt;li&gt;Click "Generate Component".&lt;/li&gt;
&lt;li&gt;Copy the generated code to use in your project!&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🛠️ Technologies Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript (Vanilla JS)&lt;/li&gt;
&lt;li&gt;Chrome Extensions API&lt;/li&gt;
&lt;li&gt;Clipboard API&lt;/li&gt;
&lt;li&gt;Canvas for Image Processing&lt;/li&gt;
&lt;li&gt;OpenAI API for AI-powered component generation (using GPT-4o model)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏗️ Development Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Clone the Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/this-is-allan/component-screenshot.git
&lt;span class="nb"&gt;cd &lt;/span&gt;component-screenshot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modify the Extension
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Edit content.js to adjust element selection behavior.&lt;/li&gt;
&lt;li&gt;Modify popup.html and popup.js to update the UI.&lt;/li&gt;
&lt;li&gt;Adjust permissions in manifest.json as needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reload the Extension
&lt;/h3&gt;

&lt;p&gt;After making changes, reload the extension from chrome://extensions/.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔑 API Key Security
&lt;/h2&gt;

&lt;p&gt;Your OpenAI API key is stored locally in your browser's storage and is only used to make requests to the OpenAI API. It is never sent to any other server.&lt;/p&gt;

&lt;h2&gt;
  
  
  🐛 Issues &amp;amp; Contributions
&lt;/h2&gt;

&lt;p&gt;Feel free to open an issue or submit a Pull Request if you want to improve the extension.&lt;/p&gt;

&lt;h2&gt;
  
  
  📜 License
&lt;/h2&gt;

&lt;p&gt;This project is licensed under the MIT License. See the LICENSE file for details.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Enjoy faster, more precise element screenshots and AI-powered component generation!
&lt;/h2&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>openai</category>
      <category>extensions</category>
    </item>
  </channel>
</rss>
