RajvardhanS-Patil/XrayUI

XrayUI is a developer-focused browser extension that enables real-time UI inspection. Hover over any element on a webpage to instantly view the underlying HTML, CSS classes, styles, and structural information, making it easier to analyze, learn from, and debug web interfaces.

TypeScript

0

1 commits

updated Jun 4, 2026

See the code

README

Explain This UI ๐Ÿ”

A production-ready Chrome Extension that lets you inspect any UI element on any webpage and instantly analyze it like a senior frontend developer โ€” powered by Google Gemini AI.

Chrome Extension Manifest V3 React TypeScript TailwindCSS


โœจ Features

๐Ÿ”Ž Element Inspector

  • Hover any element to see a live overlay with tag, classes, and dimensions
  • Click to capture and analyze the element
  • ESC to deactivate
  • Keyboard shortcut: Ctrl+Shift+I

๐Ÿ“Š Analysis Panels

PanelFeatures
InfoTag, ID, classes, box model, attributes, frameworks
StylesTypography, colors, flex/grid, computed styles with search
AccessibilityWCAG contrast ratio, ARIA, score 0โ€“100, grade Aโ€“F
DesignColor palette, typography scale, spacing system, effects
AIExplain, Generate React, Improve UI, Analyze Design
HistorySearchable, pinnable inspection history

๐Ÿค– AI Features (Gemini 1.5 Flash)

  • Explain This Component โ€” Beginner-friendly breakdown
  • Generate React Component โ€” TypeScript + TailwindCSS
  • Improve This UI โ€” Accessibility and responsive fixes
  • Analyze Design โ€” Color, typography, and hierarchy insights

๐Ÿ“‹ Export

  • Export as JSON, Markdown, or PNG
  • Copy CSS, Tailwind classes, or color palette with one click

โŒจ๏ธ Keyboard Shortcuts

ShortcutAction
Ctrl+Shift+IToggle inspector
Ctrl+KOpen command palette
1โ€“6Switch between panels
EscDeactivate inspector

๐Ÿš€ Quick Start

1. Clone & Install

git clone https://github.com/youruser/explain-this-ui
cd explain-this-ui
npm install

2. Configure API Key

cp .env.example .env

Edit .env:

VITE_GEMINI_API_KEY=your_key_here

Get a free Gemini API key at aistudio.google.com.

3. Build

npm run build

4. Load in Chrome

  1. Open Chrome โ†’ chrome://extensions
  2. Enable Developer mode (top right toggle)
  3. Click "Load unpacked"
  4. Select the dist/ folder

5. Use the Extension

  1. Click the extension icon in Chrome toolbar
  2. Click "Activate Inspector" or press Ctrl+Shift+I
  3. Hover over elements on any webpage
  4. Click any element to analyze it
  5. View the side panel for full analysis

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ background/           # Service Worker (MV3)
โ”œโ”€โ”€ content/              # Injected into pages
โ”‚   โ”œโ”€โ”€ inspector.ts      # Hover highlight + click capture
โ”‚   โ”œโ”€โ”€ analyzer.ts       # DOM + CSS extraction
โ”‚   โ”œโ”€โ”€ screenshot.ts     # Screenshot capture
โ”‚   โ””โ”€โ”€ styles.css        # Injected overlay styles
โ”œโ”€โ”€ popup/                # Extension toolbar popup
โ”œโ”€โ”€ sidepanel/            # Main analysis UI
โ”‚   โ”œโ”€โ”€ App.tsx
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ layout/       # Header, CommandPalette
โ”‚   โ”‚   โ”œโ”€โ”€ panels/       # BasicInfo, Styles, A11y, Design, AI
โ”‚   โ”‚   โ”œโ”€โ”€ history/      # InspectionHistory
โ”‚   โ”‚   โ””โ”€โ”€ ui/           # Badge, Card, CopyButton, ColorSwatch, etc.
โ”‚   โ”œโ”€โ”€ hooks/            # useInspector, useAI, useTheme
โ”‚   โ”œโ”€โ”€ services/         # ai.service, export.service
โ”‚   โ””โ”€โ”€ store/            # Zustand stores (inspector, history, settings)
โ”œโ”€โ”€ types/                # TypeScript interfaces
โ””โ”€โ”€ utils/                # color, css, accessibility, framework utils

๐Ÿ”ง Development

# Watch mode (rebuilds on save)
npm run dev

# Type check
npm run type-check

After any change in watch mode, go to chrome://extensions and click the refresh icon on the extension card.


๐ŸŒ Tech Stack

TechnologyPurpose
React 18Side panel + popup UI
TypeScript 5Type safety
TailwindCSS 3Styling
Vite 5Build tool
@crxjs/vite-pluginChrome extension HMR
Zustand 4State management
Gemini 1.5 FlashAI analysis
Lucide ReactIcons
React MarkdownAI response rendering

๐Ÿ”‘ Environment Variables

VariableDescriptionDefault
VITE_GEMINI_API_KEYGemini API key (required for AI)โ€”
VITE_OPENAI_API_KEYOpenAI API key (optional)โ€”
VITE_AI_PROVIDERgemini or openaigemini
VITE_GEMINI_MODELGemini model namegemini-1.5-flash
VITE_OPENAI_MODELOpenAI model namegpt-4o-mini

๐Ÿ“ฆ Build Output

The dist/ folder will contain:

  • manifest.json
  • background/index.js โ€” Service worker
  • content/index.js + content/styles.css โ€” Injected scripts
  • popup/index.html โ€” Toolbar popup
  • sidepanel/index.html โ€” Main analysis panel

๐Ÿ™ Credits

Built with Vite, CRXJS, TailwindCSS, and Google Gemini.


๐Ÿ“„ License

MIT

RajvardhanS-Patil/XrayUI

XrayUI is a developer-focused browser extension that enables real-time UI inspection. Hover over any element on a webpage to instantly view the underlying HTML, CSS classes, styles, and structural information, making it easier to analyze, learn from, and debug web interfaces.

TypeScript

0

1 commits

updated Jun 4, 2026

See the code

README

Explain This UI ๐Ÿ”

A production-ready Chrome Extension that lets you inspect any UI element on any webpage and instantly analyze it like a senior frontend developer โ€” powered by Google Gemini AI.

Chrome Extension Manifest V3 React TypeScript TailwindCSS


โœจ Features

๐Ÿ”Ž Element Inspector

  • Hover any element to see a live overlay with tag, classes, and dimensions
  • Click to capture and analyze the element
  • ESC to deactivate
  • Keyboard shortcut: Ctrl+Shift+I

๐Ÿ“Š Analysis Panels

PanelFeatures
InfoTag, ID, classes, box model, attributes, frameworks
StylesTypography, colors, flex/grid, computed styles with search
AccessibilityWCAG contrast ratio, ARIA, score 0โ€“100, grade Aโ€“F
DesignColor palette, typography scale, spacing system, effects
AIExplain, Generate React, Improve UI, Analyze Design
HistorySearchable, pinnable inspection history

๐Ÿค– AI Features (Gemini 1.5 Flash)

  • Explain This Component โ€” Beginner-friendly breakdown
  • Generate React Component โ€” TypeScript + TailwindCSS
  • Improve This UI โ€” Accessibility and responsive fixes
  • Analyze Design โ€” Color, typography, and hierarchy insights

๐Ÿ“‹ Export

  • Export as JSON, Markdown, or PNG
  • Copy CSS, Tailwind classes, or color palette with one click

โŒจ๏ธ Keyboard Shortcuts

ShortcutAction
Ctrl+Shift+IToggle inspector
Ctrl+KOpen command palette
1โ€“6Switch between panels
EscDeactivate inspector

๐Ÿš€ Quick Start

1. Clone & Install

git clone https://github.com/youruser/explain-this-ui
cd explain-this-ui
npm install

2. Configure API Key

cp .env.example .env

Edit .env:

VITE_GEMINI_API_KEY=your_key_here

Get a free Gemini API key at aistudio.google.com.

3. Build

npm run build

4. Load in Chrome

  1. Open Chrome โ†’ chrome://extensions
  2. Enable Developer mode (top right toggle)
  3. Click "Load unpacked"
  4. Select the dist/ folder

5. Use the Extension

  1. Click the extension icon in Chrome toolbar
  2. Click "Activate Inspector" or press Ctrl+Shift+I
  3. Hover over elements on any webpage
  4. Click any element to analyze it
  5. View the side panel for full analysis

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ background/           # Service Worker (MV3)
โ”œโ”€โ”€ content/              # Injected into pages
โ”‚   โ”œโ”€โ”€ inspector.ts      # Hover highlight + click capture
โ”‚   โ”œโ”€โ”€ analyzer.ts       # DOM + CSS extraction
โ”‚   โ”œโ”€โ”€ screenshot.ts     # Screenshot capture
โ”‚   โ””โ”€โ”€ styles.css        # Injected overlay styles
โ”œโ”€โ”€ popup/                # Extension toolbar popup
โ”œโ”€โ”€ sidepanel/            # Main analysis UI
โ”‚   โ”œโ”€โ”€ App.tsx
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ layout/       # Header, CommandPalette
โ”‚   โ”‚   โ”œโ”€โ”€ panels/       # BasicInfo, Styles, A11y, Design, AI
โ”‚   โ”‚   โ”œโ”€โ”€ history/      # InspectionHistory
โ”‚   โ”‚   โ””โ”€โ”€ ui/           # Badge, Card, CopyButton, ColorSwatch, etc.
โ”‚   โ”œโ”€โ”€ hooks/            # useInspector, useAI, useTheme
โ”‚   โ”œโ”€โ”€ services/         # ai.service, export.service
โ”‚   โ””โ”€โ”€ store/            # Zustand stores (inspector, history, settings)
โ”œโ”€โ”€ types/                # TypeScript interfaces
โ””โ”€โ”€ utils/                # color, css, accessibility, framework utils

๐Ÿ”ง Development

# Watch mode (rebuilds on save)
npm run dev

# Type check
npm run type-check

After any change in watch mode, go to chrome://extensions and click the refresh icon on the extension card.


๐ŸŒ Tech Stack

TechnologyPurpose
React 18Side panel + popup UI
TypeScript 5Type safety
TailwindCSS 3Styling
Vite 5Build tool
@crxjs/vite-pluginChrome extension HMR
Zustand 4State management
Gemini 1.5 FlashAI analysis
Lucide ReactIcons
React MarkdownAI response rendering

๐Ÿ”‘ Environment Variables

VariableDescriptionDefault
VITE_GEMINI_API_KEYGemini API key (required for AI)โ€”
VITE_OPENAI_API_KEYOpenAI API key (optional)โ€”
VITE_AI_PROVIDERgemini or openaigemini
VITE_GEMINI_MODELGemini model namegemini-1.5-flash
VITE_OPENAI_MODELOpenAI model namegpt-4o-mini

๐Ÿ“ฆ Build Output

The dist/ folder will contain:

  • manifest.json
  • background/index.js โ€” Service worker
  • content/index.js + content/styles.css โ€” Injected scripts
  • popup/index.html โ€” Toolbar popup
  • sidepanel/index.html โ€” Main analysis panel

๐Ÿ™ Credits

Built with Vite, CRXJS, TailwindCSS, and Google Gemini.


๐Ÿ“„ License

MIT