Development Tool

Visual layout debugger for development - inspect containers, padding, margins, and grid systems

🎯Quick Start
Enable the debug overlay to visualize layout structure
Step 1

Click the "Enable Debug Mode" button in the bottom-left corner

Step 2

Or use the keyboard shortcut: Ctrl+Shift+D

Step 3

Observe the visual indicators for containers, padding, and margins

Features
What the debug overlay provides

Container Visualization

Blue backgrounds and borders highlight container elements

Padding Indicators

Green backgrounds show padding areas within elements

Margin Outlines

Red dashed borders indicate margin spacing

Section Backgrounds

Yellow dotted borders highlight section elements

Grid Layouts

Purple outlines show grid container structure

Flex Layouts

Pink outlines indicate flexbox containers

Viewport Information
Real-time viewport size and breakpoint indicators

Size Display

Shows current viewport width and height in the top-right corner

Breakpoint Indicator

Displays the current responsive breakpoint (Mobile, Tablet, Desktop, Large Desktop)

Container Sizes Reference

Quick reference for standard container breakpoints (SM, MD, LG, XL, 2XL, 3XL)

Usage in Your App
How to integrate the debug overlay
// In your root layout (layout.tsx)
import { DebugOverlay } from '@repo/ui/core';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}

        {/* Add at the end of body */}
        <DebugOverlay enabled={false} />
      </body>
    </html>
  );
}
⚠️

Development Only

This is a temporary development tool. Remove before deploying to production or use conditional rendering based on environment.

Props
Configure the debug overlay
enabledbooleandefault: false

Enable debug mode by default. Users can still toggle it with Ctrl+Shift+D.

Enable the debug overlay to see how it highlights the following layout structure:

Card 1
Grid container with cards

This is a sample card to demonstrate the debug overlay.

Card 2
With padding and margins

Notice the colored overlays when debug mode is active.

Card 3
Visual indicators

Blue for containers, green for padding, red for margins.

Section Element

This section element will be highlighted with a yellow dotted border in debug mode.