บทความ

แจก Prompt: สั่ง AI ทำ Dashboard กระจก (Glassmorphism) กดได้ทุกปุ่ม ใน Prompt เดียว

แจก Prompt: สั่ง AI ทำ Dashboard กระจก (Glassmorphism) กดได้ทุกปุ่ม ใน Prompt เดียว

เห็น Dashboard สวยๆ ในรีลแล้วอยากได้แบบนั้นบ้าง ไม่ต้องเขียน Code เอง เราถอดดีไซน์ Dashboard กระจกฝ้า (Glassmorphism) จากรีลของ code.xr มาเขียนเป็น Prompt ให้แล้ว ก๊อปไปวางใน Claude หรือ Lovable ได้ Dashboard ที่สวยระดับนี้ แถมกดได้ทุกปุ่มจริง

โลโก้ Claude โลโก้ Lovable

ทำไม Prompt สั้นๆ ถึงได้ Dashboard ธรรมดา

ถ้าพิมพ์แค่ "ทำ Dashboard สวยๆ ให้หน่อย" AI จะเดาเอาเอง ผลที่ได้คือหน้าตาเหมือน Template ทั่วไป สิ่งที่ทำให้ Dashboard ในคลิปดูแพงคือรายละเอียดที่เราบอก AI ครบทุกชั้น เราจึงแบ่ง Prompt เป็น 4 ส่วน

ภาพประกอบ: Dashboard กระจกฝ้าที่ได้จาก Prompt เดียว

ส่วนที่ 1: Look บอกลุคให้ชัด

  • วัสดุ: "smoky frosted glass" กระจกฝ้าโทนเทา วางบนรูปห้องนั่งเล่นขาวดำที่เบลอไว้ข้างหลัง
  • สองชั้น: แผงใหญ่หนึ่งชั้น แล้วการ์ดเป็นกระจกอีกชั้นซ้อนบน ทำให้ดูมีมิติ
  • สีเด่นสีเดียว: ทั้งหน้าใช้สีเทา มีสีฟ้า #3B82F6 สีเดียวสำหรับ Toggle วงแหวนเป้าหมาย และแท่งกราฟที่เลือก

การจำกัดสีเหลือสีเดียวคือเคล็ดลับที่ทำให้งานดูเรียบหรู ไม่รก

ภาพอธิบาย: ส่วนที่ 1: Look บอกลุคให้ชัด

ส่วนที่ 2: Layout บอกทีละการ์ด

  • Sidebar แบบแคปซูลลอยด้านซ้าย มีแต่ไอคอน
  • Tabs ด้านบน Overview / Sales / Marketing / Support
  • เนื้อหาเป็น Bento Grid 3 Column

จุดสำคัญคือไล่บอกทุกการ์ดว่าแสดงอะไร เช่น วงแหวน Target ที่ลากปรับได้ กราฟรายได้ ปุ่มปัดเพื่ออนุมัติ และการ์ดสายโทรเข้า ยิ่งบอกละเอียด AI ยิ่งไม่ต้องเดา

ภาพอธิบาย: ส่วนที่ 2: Layout บอกทีละการ์ด

ส่วนที่ 3: Motion ทำให้มีชีวิต

  • เปลี่ยนหน้าแล้วการ์ดค่อยๆ โผล่ทีละใบ (stagger)
  • ตัวเลขวิ่งนับขึ้นจาก 0
  • กราฟและวงแหวนวาดตัวเองตอนเปิดหน้า
  • เอาเมาส์ชี้การ์ดแล้วการ์ดยกขึ้นเล็กน้อย

ส่วนที่ 4: สั่งให้ทุกปุ่มกดได้จริง

บรรทัดเดียวที่คนมักลืม: "Make every control actually work" ถ้าไม่สั่ง AI มักทำแค่ภาพนิ่งที่กดอะไรไม่ได้ พอสั่งแล้วจะได้ Tabs ที่สลับหน้าได้ Toggle ที่เปิดปิดได้ ตัวกรองตารางที่ใช้ได้จริง พร้อมข้อมูลตัวอย่าง

ภาพอธิบาย: ส่วนที่ 4: สั่งให้ทุกปุ่มกดได้จริง

เคล็ดลับ: เปลี่ยนเป็นสีแบรนด์ แก้แค่บรรทัดเดียว

อยากได้สีของแบรนด์ตัวเอง ไม่ต้องแก้ทั้ง Prompt แก้แค่บรรทัด "ONE accent" เช่นเปลี่ยนจากฟ้า #3B82F6 เป็นทอง #D4A64A ทั้งหน้าจะเปลี่ยนตามทันที

ภาพอธิบาย: เคล็ดลับ: เปลี่ยนเป็นสีแบรนด์ แก้แค่บรรทัดเดียว

Prompt เต็ม (ก๊อปไปใช้ได้เลย)

วางใน Claude หรือ Lovable ได้ทันที ถ้าอยากได้เป็นไฟล์ HTML ไฟล์เดียว ให้เปลี่ยนบรรทัดแรกเป็น "Build a single self-contained HTML file (Tailwind CDN + vanilla JS)"

Build a premium SaaS CRM dashboard in React + Tailwind CSS + framer-motion + lucide-react (no emoji, SVG icons only).

VISUAL STYLE: "smoky frosted glass" glassmorphism.
- Page background: a full-bleed black-and-white photo of a modern living room (sofa, black pendant lamps), heavily blurred behind the UI. Fallback: a soft grey radial gradient.
- App shell: one large floating glass panel (rounded-[28px], bg-white/[0.06], backdrop-blur-2xl, 1px border white/10, soft shadow, inner top highlight).
- Cards: a second glass layer on top (rounded-2xl, bg-white/[0.07], backdrop-blur-xl, border white/10). Hovered/active card gets brighter (bg-white/[0.12]).
- Palette: monochrome greys + ONE accent, bright blue #3B82F6 (toggles, progress ring, selected bar, notification badges, sparklines). Positive deltas in emerald-400 small pills, negative in rose-400.
- Text: white for big numbers, white/60 for labels, white/40 for meta.
- Font: rounded geometric sans (Lexend or Outfit). KPI numbers 28-36px semibold, tight tracking.

LAYOUT
- Left: floating vertical capsule sidebar, icon-only (Home, Search, ShoppingBag, Box, Users, LayoutGrid, MessageCircle with blue badge, Calendar, BarChart3, ChevronDown; Settings and Power at the bottom). Active icon sits in a lighter glass circle; hovering shows a small glass tooltip to the right.
- Top bar: text tabs "Overview / Sales / Marketing / Support" (active = white + short underline), right side: dashed-outline round "+" button, grid button, bell with blue count badge, avatar with green online dot.
- Overview page = 3-column bento grid:
  1. Team card: overlapping avatars + "+3", "4 online now", "+" button.
  2. Quarterly Target (tall): blue toggle, circular progress ring with a draggable knob and tick marks, big "63% Achieved", "- / +" buttons to adjust the target, bottom row of round metric chips (Revenue, Deals, Calls, Meetings), active chip white.
  3. Revenue card: "$23.1k / $27k", "+12.4% vs yesterday", segmented control Today/Week/Month, smooth white area line chart, row of hourly values.
  4. New Leads "1,186" with green delta pill and a mini bar chart (last bar blue).
  5. Approvals: "4 pending", blue DISCOUNT badge, "$4,800", subtitle, a swipe-to-approve slider pill, close "x".
  6. Right column 2x2 KPI tiles, each with an icon and on/off toggle: Customers 2,739; Pipeline $1.19M with mini horizontal funnel bars (Lead, Qualified, Proposal, Won); Active Users 300 with blue sparkline (toggled ON = card lights up); Open Tickets 17 (red delta).
  7. Sales (k$) bar chart Mon-Sun with Week/Month/Year control, Wednesday bar blue with a floating value tooltip.
  8. "Discovery Call · Northwind Co." media card: avatar, caller title, blue audio waveform with playhead, prev / pause / next controls.
- Other pages reachable from the sidebar, same glass language:
  Reports (4 KPI cards, Revenue vs Target line chart, donut "Revenue by Channel"),
  Deals Pipeline (KPI row + kanban columns Lead / Qualified / Proposal / Negotiation / Won with deal cards),
  Customers (4 KPI cards, filter chips All/Active/Trial/Lead/Churned with counts, search, Export, white "+ Add customer" pill, table with avatar, company, green "Active" status pill, owner, lifetime value, last contact),
  Products (KPI row, filter chips, search, product grid cards with vivid gradient app-style icons, price, stock bar, toggle).

MOTION (framer-motion)
- Page switch: old content fades out leaving empty glass; then card skeletons appear one by one (stagger 0.06s, scale 0.96 -> 1, opacity 0 -> 1), then content fades up with blur(8px) -> 0.
- All KPI numbers count up from 0 on mount (~0.8s, easeOut). Progress ring and line charts draw in (pathLength 0 -> 1).
- Cards lift on hover: whileHover={{ y: -5 }}, border brightens.
- Toggles spring (stiffness 500, damping 30). Avatars pop in with stagger.
- Respect prefers-reduced-motion.

QUALITY
- Fully responsive: sidebar becomes a bottom capsule bar on mobile, bento grid collapses to 1 column.
- Make every control actually work (tabs, toggles, segmented controls, +/- target, sidebar routing, table filters/search) with mock data in one data file.
- Keep icon/text contrast readable on glass (never blue text on blue).

สรุป

  • Look: กระจกฝ้าสองชั้น + สีเด่นสีเดียว
  • Layout: Sidebar แคปซูล, Tabs, Bento 3 Column และบอกทีละการ์ด
  • Motion: การ์ดโผล่ทีละใบ ตัวเลขวิ่ง กราฟวาดตัวเอง
  • ทุกปุ่มกดได้จริง: บรรทัดเดียวที่เปลี่ยน Dashboard จากรูปเป็นแอป

เซฟบทความนี้ไว้ แล้วลองทำ Dashboard ของคุณเอง ไอเดียดีไซน์จาก code.xr

ดูหลักสูตรอบรม AI สำหรับองค์กร