Designing nextjs ui

From AbdullahMalik17/Digital-FTE · View interactive version

Designing nextjs ui is an AI agent skill from the GitHub repository AbdullahMalik17/Digital-FTE. | Create professional, attractive, and visually striking user interfaces in Next.js. Use when building beautiful websites, landing pages, dashboards, or any UI that needs to stand out. Covers Tailwind CSS utilities, typography, animations, visual effects, responsive layouts, and modern design patter

How to use this skill

Skill file

Designing Professional Next.js UIs

Create visually stunning and highly functional interfaces using modern design patterns and Tailwind CSS.

Design Philosophy

Avoid generic aesthetics. Every interface should have a clear visual identity:

Balance beauty with function. Beautiful design serves the user experience:

The "Gold Standard" Stack

Don't reinvent the wheel. Use this proven combination for consistency and speed.

  1. Tailwind CSS: For utility-first styling.
  2. Shadcn UI: For copy-paste accessible components (based on Radix UI).
  3. Framer Motion: For declarative animations.
  4. Lucide React: For consistent, clean iconography.

Visual Hierarchy & Typography

Fonts (`next/font`)

Use next/font/google to eliminate layout shift.

import { Inter, Playfair_Display } from 'next/font/google'

const inter = Inter({ subsets: ['latin'], variable: '--font-inter' })
const playfair = Playfair_Display({ subsets: ['latin'], variable: '--font-playfair' })

export default function RootLayout({ children }) {
  return (
    <html lang="en" className={`${inter.variable} ${playfair.variable}`}>
      <body className="font-sans antialiased">{children}</body>
    </html>
  )
}

Data Presentation Patterns

1. KPI / Metric Cards

Isolate key numbers. Use the "Label (Muted) -> Value (Bold) -> Context (Color)" hierarchy.

// See references/ui-patterns.md for full component code
<Card>
  <CardHeader className="pb-2">
    <CardTitle className="text-sm font-medium text-muted-foreground">
      Total Revenue
    </CardTitle>
  </CardHeader>
  <CardContent>
    <div className="text-2xl font-bold">$45,231.89</div>
    <p className="text-xs text-emerald-500 flex items-center mt-1">
      +20.1% from last month
    </p>
  </CardContent>
</Card>

2. The "Bento Grid" Layout

Organize dashboard widgets into a grid of distinct rectangular areas.

<div className="grid grid-cols-1 md:grid-cols-4 gap-4 p-4">
  <div className="md:col-span-2 md:row-span-2 rounded-xl border bg-card text-card-foreground shadow">
    {/* Main Chart */}
  </div>
  <div className="md:col-span-1 rounded-xl border bg-card text-card-foreground shadow">
    {/* KPI 1 */}
  </div>
  <div className="md:col-span-1 rounded-xl border bg-card text-card-foreground shadow">
    {/* KPI 2 */}
  </div>
  <div className="md:col-span-2 rounded-xl border bg-card text-card-foreground shadow">
    {/* Recent Activity List */}
  </div>
</div>

3. Professional Tables

Visual Effects & Modern UI

Gradient Text (Eye-Catching)

Create stunning gradient text effects:

<h1 className="text-5xl font-extrabold">
  <span className="bg-gradient-to-r from-pink-500 to-violet-500 bg-clip-text text-transparent">
    Beautiful Gradient
  </span>
</h1>

Glass Morphism (Modern Depth)

Frosted glass effect for cards and overlays:

<div className="bg-white/10 backdrop-blur-lg rounded-xl p-6 ring-1 ring-white/20 shadow-xl">
  <h3>Glass Card</h3>
</div>

Animations & Motion

Use animations strategically for attention and feedback:

See references/visual-effects.md for comprehensive guide on gradients, shadows, blur effects, animations, and hover patterns.

Advanced Typography

Making Words Stand Out

Color Emphasis:

<p className="text-gray-700">
  Normal text with <span className="font-semibold text-violet-600">highlighted words</span>
</p>

Gradient Text:

<span className="bg-gradient-to-r from-yellow-400 to-pink-500 bg-clip-text text-transparent">
  Vibrant text
</span>

Background Highlight:

<span className="bg-yellow-200 px-1 font-medium">marked text</span>

Weight & Size Contrast:

See references/typography-advanced.md for font loading, hierarchy systems, responsive typography, and dark mode patterns.

Responsive Layouts

Mobile-First Approach

Always design for mobile first, then enhance for larger screens:

<div className="
  grid grid-cols-1           /* Mobile: single column */
  sm:grid-cols-2             /* Tablet: 2 columns */
  lg:grid-cols-3             /* Desktop: 3 columns */
  gap-4 sm:gap-6 lg:gap-8    /* Progressive spacing */
">
  {/* Grid items */}
</div>

Spacing Scale

Use consistent spacing (0.25rem increments):

Layout Patterns

See references/layout-patterns.md for complete responsive patterns, Flexbox, Grid systems, spacing utilities, and container patterns.

Micro-Interactions (Framer Motion)

Make the app feel "alive" but not noisy.

// Subtle fade-in for page content
<motion.div
  initial={{ opacity: 0, y: 10 }}
  animate={{ opacity: 1, y: 0 }}
  transition={{ duration: 0.3 }}
>
  {children}
</motion.div>

Quick Reference

Typography:

Visual Effects:

Layout:

Colors:

Verification

Run: python scripts/verify.py

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.