跳到正文
VibeFather
免费注册

用这个模板做的 2 个案例

同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。

关于这个模板

一个面向小型网店的单页管理应用:可折叠侧边栏下包含四个视图——概览(四张带涨跌幅的 KPI 卡片、用内联 SVG 绘制的 30 天营收面积图、热销商品条形列表、最近订单);订单(密集表格,带状态标签、文本搜索和状态筛选标签页,点击某行会打开详情抽屉,内含订单明细和时间线);商品(列表加编辑表单,带实时校验和自动生成的字母组合图标,保存到 localStorage);库存(低库存预警行,带快捷补货步进器和 Toast 确认提示)。数据为虚构,首次加载时写入 localStorage,顶栏按钮可重置演示数据并弹出确认 Toast。默认店铺销售虚构的户外装备,但结构适用于任何小店铺的后台。视觉风格干净利落:冷灰色底、白色面板、单一靛蓝强调色,图表均为手写实现,工艺感可见。不使用图表或表格库,不发起网络请求。

模板提示词

在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。

# E-commerce Admin Dashboard

Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else.

## Brief
A single-page admin app for [SHOP], a small online store selling [NICHE]. Sidebar views: Overview (KPIs, 30-day revenue chart, top products, recent orders), Orders (filterable table with a detail drawer), Products (list + editor form), Inventory (low-stock alerts with restock). Data is invented sample content seeded into localStorage once; a Reset demo data button restores it. One page, index.html; everything runs in the browser.

- Audience: The store's owner-operator, checking numbers between packing slips on a laptop. They want the day's shape in one glance and the two actions they do daily — fix stock, edit a product — one click deep.
- Goal: Make a small store feel run well. Within ten seconds the visitor sees revenue, orders and the one alert that matters; within a minute they have opened an order, fixed stock and edited a product.
- Tone: Back-office calm: exact numbers, short labels, no motivational copy. One dry joke in the empty-state row.

## Stack
- Framework: Vite 5 + React 18 + TypeScript
- Styling: Tailwind CSS 3.4
- Libraries: react (MIT), react-dom (MIT), motion (motion.dev, import from 'motion/react') (MIT), lucide-react (ISC), tailwindcss (MIT), postcss (MIT), autoprefixer (MIT), vite (MIT), @vitejs/plugin-react (MIT), typescript (Apache-2.0), @fontsource-variable/instrument-sans (OFL-1.1), @fontsource/jetbrains-mono (OFL-1.1)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
  - Scaffold with npm create vite@latest using the react-ts template (pin the version if the latest template targets newer majors), then keep one real HTML page: index.html (entry src/main.tsx).
  - vite.config.ts: base './', plugins [react()], build { outDir 'dist', sourcemap false, assetsInlineLimit 0 }. Do not copy src/ into dist/.
  - Tailwind 3.4 through PostCSS, content ['./index.html', './src/**/*.{ts,tsx}']. In tailwind.config.ts add every color under Design to theme.extend.colors with kebab-case keys (ground, panel, panel-2, line, ink, softink, indigo, indigo-deep, indigo-mist, mint, amber, ruby, slateink, good) and fontFamily sans ['Instrument Sans Variable', 'system-ui', 'sans-serif'], mono ['JetBrains Mono', 'ui-monospace', 'monospace']. Set borderRadius DEFAULT to 10px and add maxWidth { shell: '1480px' }.
  - In src/fonts.ts import '@fontsource-variable/instrument-sans' and '@fontsource/jetbrains-mono/400.css' plus '500.css' and '600.css'; import src/fonts.ts and src/index.css from the entry file.
  - File layout: src/content.ts (store facts, product roster, order roster, seeded series and every label, typed), src/lib/brand.ts (shopSlug = [SHOP] lowercased with every run of non-alphanumeric characters replaced by '-', emailDomain = shopSlug without hyphens + '.com', storageKey = shopSlug + ':admin'), src/lib/storage.ts (safe localStorage get/set wrapped in try/catch), src/lib/seed.ts (builds the dataset { products, orders, series } from content.ts on first run or after reset; products: { id, name, sku, price, stock, status, emoji-free monogram }, orders: { id, customer, items: [{ productId, qty }], status, total, placed: relative label }, series: 30 revenue points), src/lib/money.ts (money(n) en-US, no cents on KPIs, cents on orders).
  - State: src/store/shop.ts is a tiny external store (useSyncExternalStore) holding the dataset plus { view, orderQuery, statusFilter, editingId, toasts }; every mutation (edit product, restock, advance status, reset) writes through to localStorage under storageKey and emits.
  - Components in src/components/: Shell.tsx (Sidebar.tsx with ViewButton.tsx, Topbar.tsx with SearchHint, ResetButton.tsx), Toasts.tsx (ToastRow.tsx), KpiCard.tsx (Delta.tsx), RevenueChart.tsx (inline SVG: area path with gradient fill, x axis of 6 mono day labels, hover crosshair with a value bubble), TopProducts.tsx (BarRow.tsx), RecentOrders.tsx; OrdersView.tsx (OrdersTable.tsx, StatusChip.tsx, OrderDrawer.tsx with LineItem.tsx and Timeline.tsx), ProductsView.tsx (ProductRow.tsx, ProductEditor.tsx with Field.tsx, MonogramTile.tsx), InventoryView.tsx (AlertRow.tsx with RestockStepper.tsx). src/pages/App.tsx composes them.
  - RevenueChart: viewBox 640x220, path from the series, smooth (catmull-rom to bezier), indigo gradient fill at 18%; a crosshair line and value bubble follow pointermove on desktop only; the chart is decorative-informational, not interactive-critical, so it stays static under reduced motion.
  - OrderDrawer: slides from the right (width 420px, 320ms --ease-io), traps focus, Escape closes; line items with monogram tiles; a Timeline of four status steps with the current one lit; buttons advance status (paid → packed → shipped) and emit a toast.
  - ProductEditor: inline in a right panel (same drawer pattern); fields name, sku (mono, auto-suggested but editable), price, stock, status select; validation inline (red Ruby text under the field); Save emits a toast and updates the list; New product starts blank with a generated sku.
  - Reset: the topbar button opens a small confirm popover ('Reseed demo data? Your edits go away.') — Reset reseeds and toasts 'Demo data reseeded'.
  - public/favicon.svg as described under Assets. index.html: lang en, <meta name='theme-color' content='#F4F5F7'>, <link rel='icon' href='./favicon.svg' type='image/svg+xml'>, <title>[SHOP] — store admin</title>.
  - Write ASSETS.md at the project root as described under Assets.
  - dist/ holds index.html, hashed JS/CSS, the woff2 fonts and favicon.svg. Keep it under 4 MB.

## Variables
- [SHOP] — Store name (default: "Trailhead Supply"). The invented store's name. Used in the wordmark, title, footer, email (orders@ + shopSlug without hyphens + '.com') and the localStorage key. Never a real retailer.
- [NICHE] — What it sells (default: "outdoor gear and trail kit"). One lowercase phrase naming the catalog. Rewrites product names, SKUs, the overview copy and order items so they fit that store. Keep it concrete.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/e-commerce-admin-dashboard in the footer (default: yes; delete this line to remove it)

The copy under Pages & Sections is written for the default values. If your values differ, rewrite every headline, paragraph, label and image for them — same length, tone and structure. Layout, colors, type and motion stay as described.
Keep all copy, image paths and links in one content file (for example `src/content.ts`), keyed by section, so the content can be swapped later without touching components.

## Design
### Colors
- Ground `#F4F5F7` — App background.
- Panel `#FFFFFF` — Cards, table, drawer, sidebar.
- Panel 2 `#F7F8FA` — Table header rows, hover fill, sidebar footer.
- Line `#E3E5EA` — 1px hairlines: borders, table rows, dividers.
- Ink `#171A20` — Headings, body, icons.
- Soft Ink `#5F6570` — Secondary text, captions, axis labels.
- Indigo `#4F46E5` — The one accent: active nav, links, primary buttons, chart line, focus ring, selected rows.
- Indigo Deep `#3B34B8` — Hover and pressed primary.
- Indigo Mist `#EEEDFC` — Selected fills, chip backgrounds, chart gradient base.
- Mint `#2F9E6E` — Positive deltas, paid/packed/shipped chips, success toasts.
- Amber `#C77E1D` — Pending chips, restock hints.
- Ruby `#C24141` — Refunded chips, validation errors, overdue alerts.
- Slate Ink `#12131A` — Text on indigo fills.
- Good `#2F9E6E` — Alias kept for success semantics.

### Typography
- Text and display: headings, labels, table text — Instrument Sans, workaday grotesque: Instrument Sans (OFL), weights 400/500/600
- Mono: money, SKUs, order ids, axis labels — tabular everywhere: JetBrains Mono (OFL), weights 400/500

### Layout & motion
- Spacing: 8px base unit. Shell: fixed sidebar 232px (collapses to 64px icon rail with a toggle, remembered in localStorage), content max-width 1480px with 32px padding (20px under 900px). Panels: 20px inner padding, 10px radius, 1px Line border. View header rows 48px tall. Table rows 52px, 12px cell padding, mono numerals right-aligned. Type scale: view titles 24px 600; KPI figures JetBrains 600 28px tabular; table and body 14px / 1.5; captions 12.5px Soft Ink; sidebar items 14px 500 with 36px rows. Buttons: height 38px, Instrument 600 13.5px; primary Indigo fill with white text, ghost 1px Line border. Inputs: height 38px, Panel fill, 1px Line border, focus Indigo border + 2px offset ring. Focus everywhere: 2px Indigo outline, 3px offset.
- Radius: 10px on panels and drawers; 8px on buttons, inputs, chips; 999px for status chips and toasts.
- Motion: Easing: --ease-io cubic-bezier(0.65, 0, 0.35, 1) for drawers; --ease-out cubic-bezier(0.22, 0.61, 0.36, 1) for the rest. Office-hours quick: nothing over 320ms.
- Motion: View swap: panels fade 6px up over 240ms; the sidebar's active item swaps a 2px Indigo rail instantly.
- Motion: KPI deltas: the arrows and +/− colors set immediately; figures count to value over 500ms on first view of Overview.
- Motion: RevenueChart: the area path draws once on view (clip-path reveal 700ms); the crosshair bubble follows pointer with no easing lag.
- Motion: Orders table: filter changes reflow with a 140ms fade on rows (no layout animation); the selected row holds an Indigo Mist fill.
- Motion: OrderDrawer / editor panel: slide 320ms --ease-io with a Line-left border and soft shadow; scrim at 24% Ink.
- Motion: Toasts: rise 8px and fade in 180ms, auto-dismiss 2.8s with a thin progress bar, exit fade 160ms.
- Motion: Restock steppers: qty changes pop the figure 1→1.15→1 (120ms); the stock cell flashes Mint once.
- Motion: prefers-reduced-motion: reduce — no counting, no chart reveal (final state), no row fades; drawers still slide (they are navigation, capped at 150ms) or fade if the UA prefers. Use CSS @media in index.css plus Motion's useReducedMotion.
- Imagery: No photographs, no logos, no avatars: products render as MonogramTiles (two-letter tiles on Indigo Mist with Ink initials), orders carry customer initials dots, and every chart is inline SVG. Icons: lucide-react only, stroke width 1.75. The favicon is drawn SVG.

## Pages & Sections
### Store admin (`index.html`)
1. **Content file and copy rules** — All copy below is written for the defaults ([SHOP] = Trailhead Supply, [NICHE] = outdoor gear and trail kit). Put every string, product, order, series point and label in src/content.ts and render from it. If any variable differs, rewrite the store blurb, all product names/SKUs, order items and the overview copy so they are specific and believable for that store, keeping the same structure and counts (8 products, 12 orders, 4 views). Products (name · sku · price · stock · status): 'Ridgeline Daypack 28L' th-101 $138 14 active; 'Storm Shell Anorak' th-205 $189 6 low; 'Merino Trail Socks (3-pack)' th-310 $24 52 active; 'Titanium Pour-Over Kit' th-412 $76 3 low; 'Cirrus Down Layer' th-208 $249 9 active; 'Trail Notebook (pocket)' th-501 $12 120 active; 'Headlamp 400 (warm)' th-330 $42 0 out; 'Camp Chair Lite' th-610 $58 7 low. Orders: 12 invented orders (names like 'M. Alvarez', 'J. Okafor' — initials only in the table), statuses across paid/packed/shipped/refunded, totals derived from items, placed labels as static relative text ('2h ago', '1d ago' … '9d ago'). Series: 30 revenue points between $310 and $1,840 with a believable weekly rhythm. Overview copy: 'Revenue, last 30 days' / 'Orders' / 'Average order' / 'Units sold' as the four KPIs; top products titled 'What moved'; recent orders titled 'Latest'; the inventory view greets with 'Three things need you' when three alerts exist, else the count line.
   Layout: n/a
   Motion: n/a
2. **Sidebar** — Wordmark block: '[SHOP]' (Instrument 600 17px) over 'STORE ADMIN' (10px uppercase Soft Ink). ViewButtons with lucide icons: Overview (LayoutDashboard), Orders (Receipt), Products (Package), Inventory (AlertTriangle). Footer block: 'orders@' + emailDomain and a collapsed-state tooltip. The collapse toggle (PanelIcon) sits at the foot; state persists.
   Layout: Fixed left, full height, Panel fill, Line right border; 232px expanded / 64px rail with labels hidden.
3. **Topbar** — Left: the current view name (600 16px) and a one-line store blurb 'Small shop, [NICHE]' (13px Soft Ink). Right: a 'Reseed demo data' ghost button (RotateCcw icon) with its confirm popover, and a Good status dot 'Synced locally' with the tooltip 'Demo data lives in this browser'. The search box lives only in the Orders view.
   Layout: Sticky within content, 64px tall, Panel fill with Line bottom border, 32px side padding.
4. **Overview view** — Four KpiCards (Revenue $28,412 +12.4% / Orders 412 +6.1% / Average order $68.96 −1.8% / Units sold 638 +9.3% — sample figures from the series): label (12.5px Soft Ink), figure (JetBrains 600 28px), Delta chip with arrow (Mint up / Ruby down). Below, a 2:1 grid: RevenueChart (title 'Revenue, last 30 days', the SVG area chart, mono axis labels every 5th point, a caption 'Sample series — reseed for a different week') and TopProducts (five BarRow entries: name, units, a bar scaled to max, price). RecentOrders: a compact 5-row table (order id mono, customer initials dot, items count, status chip, total) linking into Orders with the drawer open.
   Layout: Grid: KPIs 4 columns 20px gap (2 under 1100px, 1 under 640px); chart:products 2:1 (stacked under 1100px); recent orders full-width Panel.
5. **Orders view** — Toolbar: search input (height 38px, 'Search id or customer'), status tabs (All / Paid / Packed / Shipped / Refunded) as pill chips with counts, and the live result count ('Showing 12 of 12'). OrdersTable: columns Order (mono id), Customer (initials dot + name), Items (count + first product name), Status (StatusChip), Total (mono, right). Row click opens OrderDrawer: header (id, customer, placed label), LineItems with MonogramTile + qty + line total, subtotal/shipping/total rows, the Timeline (placed → paid → packed → shipped with current lit), and a primary advance button ('Mark as packed' etc.; refunded orders show 'Refund logged' and no button). Empty state: 'Nothing matches — even the spreadsheet is embarrassed.'
   Layout: Full-width Panel; toolbar row above the table; drawer over a scrim.
6. **Products view** — Left: the product list rows (MonogramTile, name, sku mono, price, stock with a low/out chip when relevant, status). Row click or 'Edit' opens the ProductEditor drawer; a 'New product' primary button starts a blank editor. Editor: name, sku (mono, pre-filled th-7xx on new), price (numeric, validated), stock (numeric), status (active/hidden select); inline validation on blur; Save writes through, toasts 'Saved — [name] updated' (or 'added'), and the list reflects it instantly. Out-of-stock rows carry a Ruby chip and stay editable.
   Layout: List max-width 880px; editor as the right drawer (width 420px).
7. **Inventory view** — Heading line: 'Alerts' with the count. AlertRows for stock ≤ 7: MonogramTile, name, sku, current stock (Ruby when 0, Amber otherwise), a RestockStepper (+1/+5/×2 quick chips and a numeric input), and 'Restock' applying the change: the cell flashes Mint, a toast confirms 'Restocked [name] +N', the row leaves the list when stock > 7. A quiet footer line: 'Restocks are demo-only — no suppliers were contacted.'
   Layout: Alert rows in a Panel list, max-width 880px; header row 48px.

## Assets
- image: No photographs or downloaded images: MonogramTiles, initials dots, charts and the favicon are drawn in code. Do not fetch or hotlink anything.
- image: Write ASSETS.md at the project root listing the code-drawn assets (monogram tiles, initials dots, revenue chart, favicon — 'drawn in code, original') and the npm packages: @fontsource-variable/instrument-sans and @fontsource/jetbrains-mono (OFL-1.1) and lucide-react (ISC).
- icon: lucide-react only: AlertTriangle, ArrowDownRight, ArrowUpRight, ChevronRight, LayoutDashboard, Package, Receipt, RotateCcw, Search, X. Stroke width 1.75, 16–20px, color inherits. public/favicon.svg: viewBox 0 0 32 32, a 32x32 rounded square filled #4F46E5, three white horizontal bars of decreasing width (a quiet bar-chart glyph). No brand logos.
- font: Install @fontsource-variable/instrument-sans and @fontsource/jetbrains-mono and import them in src/fonts.ts as listed in Setup. Vite bundles the woff2 files into dist/.

## Don'ts
- No backend, no form submission, no fetch to API: every mutation writes to localStorage under the store key and says 'demo' where honesty matters; reseed restores the original sample data.
- Every internal link points to a file name or in-app view (./index.html, the four sidebar views) — never to a bare directory; there is exactly one page.
- No real stores, marketplaces, analytics or payment brands (Shopify, Stripe, Meta, GA); the store, products, orders and customers are invented sample data.
- No chart or table library: the revenue chart is hand-rolled SVG and tables are semantic <table>s.
- No dates rendered from the real clock: placed labels are static sample text ('2h ago'), the chart axis shows sample day labels, and nothing prints today's date or years.
- No photographs, no people, no avatars; initials dots and monogram tiles only.
- Self-host everything: fonts through Fontsource, icons as npm packages or inline SVG. No CDN <script> or <link> tags, no Google Fonts, no analytics.
- Production build: minified, no source maps, no src/ copied into dist/, single command npm run build, output in dist/ under 4 MB.
- Never mention VibeFather inside the site except the footer credit line 'Built with a VibeFather template' linking https://vibefather.ai in the sidebar footer.
- Respect prefers-reduced-motion: no counting, no chart reveal animation, no row fades; drawers remain usable.
- The app must work at 1440x900 desktop and 390x844 mobile (sidebar becomes a bottom icon bar under 900px) with zero console errors; tables, drawers, steppers and forms work with keyboard only and visible focus rings.
- Accessibility: drawers trap focus and close on Escape; status chips carry text (never color alone); tables use real th scopes; toasts are aria-live polite.

---
— Prompt by VibeFather · https://vibefather.ai/t/e-commerce-admin-dashboard · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# 电商管理后台(E-commerce Admin Dashboard)

完全按照以下描述构建此网站。将 [VARIABLES] 替换为你自己的值;其余内容保持不变。

## 简介
一个为 [SHOP] 打造的单页管理应用,[SHOP] 是一家销售 [NICHE] 的小型在线商店。侧边栏视图:概览(KPI、30 天营收图表、热销商品、最近订单)、订单(可筛选表格,带详情抽屉)、商品(列表 + 编辑表单)、库存(低库存提醒,可补货)。数据为虚构的示例内容,一次性写入 localStorage;一个 Reset demo data 按钮可将其恢复。单页,index.html;一切都在浏览器中运行。

- 受众:商店的业主兼运营者,在笔记本电脑上、打包单据之间查看数据。他们希望一眼看清当天的整体情况,并且每天要做的两个操作——修复库存、编辑商品——只需一次点击即可到达。
- 目标:让一家小商店显得运营良好。访客在十秒内看到营收、订单和唯一真正重要的提醒;在一分钟内打开一笔订单、修复库存并编辑一个商品。
- 语气:后台式的平静:精确的数字、简短的标签、没有激励性文案。空状态行里有一句冷幽默。

## 技术栈(Stack)
- 框架(Framework):Vite 5 + React 18 + TypeScript
- 样式(Styling):Tailwind CSS 3.4
- 库(Libraries):react(MIT)、react-dom(MIT)、motion(motion.dev,从 'motion/react' 导入)(MIT)、lucide-react(ISC)、tailwindcss(MIT)、postcss(MIT)、autoprefixer(MIT)、vite(MIT)、@vitejs/plugin-react(MIT)、typescript(Apache-2.0)、@fontsource-variable/instrument-sans(OFL-1.1)、@fontsource/jetbrains-mono(OFL-1.1)
- 构建(Build):`npm run build` → 静态文件输出到 `dist/`。无后端、无服务端代码、无外部 API。
- 初始化(Setup):
  - 使用 react-ts 模板通过 npm create vite@latest 脚手架创建(如果最新模板面向更新的主版本,则固定版本),然后保留一个真实的 HTML 页面:index.html(入口 src/main.tsx)。
  - vite.config.ts:base './',plugins [react()],build { outDir 'dist',sourcemap false,assetsInlineLimit 0 }。不要将 src/ 复制到 dist/。
  - 通过 PostCSS 使用 Tailwind 3.4,content ['./index.html', './src/**/*.{ts,tsx}']。在 tailwind.config.ts 中,将设计(Design)下的每种颜色以 kebab-case 键添加到 theme.extend.colors(ground、panel、panel-2、line、ink、softink、indigo、indigo-deep、indigo-mist、mint、amber、ruby、slateink、good),并将 fontFamily sans 设为 ['Instrument Sans Variable', 'system-ui', 'sans-serif'],mono 设为 ['JetBrains Mono', 'ui-monospace', 'monospace']。将 borderRadius DEFAULT 设为 10px,并添加 maxWidth { shell: '1480px' }。
  - 在 src/fonts.ts 中导入 '@fontsource-variable/instrument-sans' 和 '@fontsource/jetbrains-mono/400.css' 以及 '500.css' 和 '600.css';从入口文件导入 src/fonts.ts 和 src/index.css。
  - 文件布局:src/content.ts(存储事实、产品名册、订单名册、种子序列和每个标签,带类型),src/lib/brand.ts(shopSlug = [SHOP] 转为小写,并将每段连续的非字母数字字符替换为 '-',emailDomain = 去掉连字符的 shopSlug + '.com',storageKey = shopSlug + ':admin'),src/lib/storage.ts(安全的 localStorage get/set,用 try/catch 包裹),src/lib/seed.ts(在首次运行或重置后从 content.ts 构建数据集 { products, orders, series };products:{ id, name, sku, price, stock, status, 无 emoji 的字母组合图案 },orders:{ id, customer, items: [{ productId, qty }], status, total, placed: 相对标签 },series:30 个收入数据点),src/lib/money.ts(money(n) 使用 en-US,KPI 上不显示美分,订单上显示美分)。
  - 状态(State):src/store/shop.ts 是一个小型外部 store(useSyncExternalStore),持有数据集以及 { view, orderQuery, statusFilter, editingId, toasts };每次变更(编辑产品、补货、推进状态、重置)都会写入 storageKey 下的 localStorage 并发出通知。
  - 组件位于 src/components/:Shell.tsx(Sidebar.tsx 含 ViewButton.tsx,Topbar.tsx 含 SearchHint、ResetButton.tsx),Toasts.tsx(ToastRow.tsx),KpiCard.tsx(Delta.tsx),RevenueChart.tsx(内联 SVG:带渐变填充的面积路径,6 个 mono 日期标签的 x 轴,悬停十字准线带数值气泡),TopProducts.tsx(BarRow.tsx),RecentOrders.tsx;OrdersView.tsx(OrdersTable.tsx、StatusChip.tsx、OrderDrawer.tsx 含 LineItem.tsx 和 Timeline.tsx),ProductsView.tsx(ProductRow.tsx、ProductEditor.tsx 含 Field.tsx、MonogramTile.tsx),InventoryView.tsx(AlertRow.tsx 含 RestockStepper.tsx)。src/pages/App.tsx 组合它们。
  - RevenueChart:viewBox 640x220,路径来自 series,平滑(catmull-rom 转 bezier),indigo 渐变填充 18%;十字准线和数值气泡仅在桌面端跟随 pointermove;图表是装饰性信息,不是交互关键,因此在减少动态效果下保持静态。
  - OrderDrawer:从右侧滑入(宽度 420px,320ms --ease-io),焦点陷阱,Escape 关闭;行项目带字母组合图案;四步状态的 Timeline,当前步骤点亮;按钮推进状态(paid → packed → shipped)并发出 toast。
  - ProductEditor:内联在右侧面板(同样的抽屉模式);字段 name、sku(mono,自动建议但可编辑)、price、stock、status 选择;内联验证(字段下方红色 Ruby 文本);Save 发出 toast 并更新列表;New product 以空白开始并生成 sku。
  - 重置(Reset):顶栏按钮打开一个小确认弹出框('Reseed demo data? Your edits go away.')——Reset 重新播种并 toast 'Demo data reseeded'。
  - public/favicon.svg 如资源(Assets)下所述。index.html:lang en,<meta name='theme-color' content='#F4F5F7'>,<link rel='icon' href='./favicon.svg' type='image/svg+xml'>,<title>[SHOP] — store admin</title>。
  - 在项目根目录编写 ASSETS.md,如资源(Assets)下所述。
  - dist/ 包含 index.html、带哈希的 JS/CSS、woff2 字体和 favicon.svg。保持在 4 MB 以下。

## 变量
- [SHOP] — 商店名称(默认:“Trailhead Supply”)。虚构商店的名称。用于字标、标题、页脚、电子邮件(orders@ + 不含连字符的 shopSlug + '.com')以及 localStorage 键。绝非真实零售商。
- [NICHE] — 销售的商品(默认:“outdoor gear and trail kit”)。一个描述商品目录的小写短语。重写产品名称、SKU、概览文案和订单项,使其符合该商店。保持具体。
- [CREDIT] — 在页脚保留一个指向 https://vibefather.ai/t/e-commerce-admin-dashboard 的小型“Template by VibeFather”链接(默认:是;删除此行即可移除)

“页面与区块”下的文案是按默认值编写的。如果你的值不同,请为它们重写每个标题、段落、标签和图片——保持相同的长度、语气和结构。布局、颜色、字体和动效保持所述不变。
将所有文案、图片路径和链接放在一个内容文件中(例如 `src/content.ts`),按区块作为键,以便之后无需改动组件即可替换内容。

## 设计
### 颜色(Colors)
- 底色(Ground)`#F4F5F7` — 应用背景。
- 面板(Panel)`#FFFFFF` — 卡片、表格、抽屉、侧边栏。
- 面板 2(Panel 2)`#F7F8FA` — 表头行、悬停填充、侧边栏页脚。
- 线条(Line)`#E3E5EA` — 1px 细线:边框、表格行、分隔线。
- 墨色(Ink)`#171A20` — 标题、正文、图标。
- 柔和墨色(Soft Ink)`#5F6570` — 次要文本、说明文字、坐标轴标签。
- 靛蓝(Indigo)`#4F46E5` — 唯一强调色:激活导航、链接、主按钮、图表线、焦点环、选中行。
- 深靛蓝(Indigo Deep)`#3B34B8` — 主按钮的悬停与按下状态。
- 靛蓝雾(Indigo Mist)`#EEEDFC` — 选中填充、标签背景、图表渐变基底。
- 薄荷绿(Mint)`#2F9E6E` — 正向增量、已付款/已打包/已发货标签、成功提示。
- 琥珀色(Amber)`#C77E1D` — 待处理标签、补货提示。
- 宝石红(Ruby)`#C24141` — 已退款标签、验证错误、逾期警报。
- 石板墨(Slate Ink)`#12131A` — 靛蓝填充上的文字。
- 良好(Good)`#2F9E6E` — 为成功语义保留的别名。

### 字体排印(Typography)
- 文本与展示:标题、标签、表格文本 — Instrument Sans,日常 grotesque 字体:Instrument Sans (OFL),字重 400/500/600
- 等宽:金额、SKU、订单 ID、坐标轴标签 — 处处使用表格数字:JetBrains Mono (OFL),字重 400/500

### 布局与动效(Layout & motion)
- 间距:8px 基准单位。外壳:固定侧边栏 232px(可通过切换按钮折叠为 64px 图标栏,状态记忆在 localStorage 中),内容最大宽度 1480px,内边距 32px(900px 以下为 20px)。面板:内边距 20px,圆角 10px,1px 线条边框。视图标题行高 48px。表格行高 52px,单元格内边距 12px,等宽数字右对齐。字号体系:视图标题 24px 600;KPI 数字 JetBrains 600 28px 表格数字;表格与正文 14px / 1.5;说明文字 12.5px 柔和墨色;侧边栏项 14px 500,行高 36px。按钮:高度 38px,Instrument 600 13.5px;主按钮靛蓝填充配白色文字,幽灵按钮 1px 线条边框。输入框:高度 38px,面板填充,1px 线条边框,聚焦时靛蓝边框 + 2px 偏移环。全局焦点:2px 靛蓝轮廓,3px 偏移。
- 圆角:面板与抽屉 10px;按钮、输入框、标签 8px;状态标签与提示 999px。
- 动效:缓动:抽屉使用 --ease-io cubic-bezier(0.65, 0, 0.35, 1);其余使用 --ease-out cubic-bezier(0.22, 0.61, 0.36, 1)。办公时段快速原则:任何动效不超过 320ms。
- 动效:视图切换:面板在 240ms 内淡入并上移 6px;侧边栏激活项即时切换 2px 靛蓝竖条。
- 动效:KPI 增量:箭头与 +/− 颜色立即设置;首次查看概览时数字在 500ms 内计数到目标值。
- 动效:RevenueChart:面积路径在视图出现时绘制一次(clip-path 揭示 700ms);十字准星气泡跟随指针,无缓动延迟。
- 动效:订单表格:筛选变化时行以 140ms 淡入重排(无布局动画);选中行保持靛蓝雾填充。
- 动效:OrderDrawer / 编辑器面板:以 320ms --ease-io 滑入,带左侧线条边框与柔和阴影;遮罩为 24% 墨色。
- 动效:提示:上移 8px 并在 180ms 内淡入,2.8s 后自动消失并带细进度条,退出淡出 160ms。
- 动效:补货步进器:数量变化时数字弹跳 1→1.15→1(120ms);库存单元格闪烁薄荷绿一次。
- 动效:prefers-reduced-motion: reduce — 无计数、无图表揭示(直接最终状态)、无行淡入;抽屉仍滑动(属于导航,上限 150ms),或按 UA 偏好改为淡入。在 index.css 中使用 CSS @media,并结合 Motion 的 useReducedMotion。
- 图像:无照片、无徽标、无头像:产品渲染为 MonogramTiles(靛蓝雾底上的双字母方块,墨色首字母),订单带有客户首字母圆点,所有图表均为内联 SVG。图标:仅使用 lucide-react,描边宽度 1.75。favicon 为绘制的 SVG。

## 页面与区块
### 商店管理后台(`index.html`)
1. **内容文件与文案规则** — 以下所有文案均针对默认值编写([SHOP] = Trailhead Supply,[NICHE] = 户外装备与徒步用品)。将每个字符串、产品、订单、系列数据点和标签都放入 src/content.ts 并从中渲染。若任何变量不同,请重写商店简介、所有产品名称/SKU、订单条目和概览文案,使其针对该商店具体且可信,同时保持相同的结构和数量(8 个产品、12 个订单、4 个视图)。产品(名称 · sku · 价格 · 库存 · 状态):'Ridgeline Daypack 28L' th-101 $138 14 active;'Storm Shell Anorak' th-205 $189 6 low;'Merino Trail Socks (3-pack)' th-310 $24 52 active;'Titanium Pour-Over Kit' th-412 $76 3 low;'Cirrus Down Layer' th-208 $249 9 active;'Trail Notebook (pocket)' th-501 $12 120 active;'Headlamp 400 (warm)' th-330 $42 0 out;'Camp Chair Lite' th-610 $58 7 low。订单:12 个虚构订单(姓名如 'M. Alvarez'、'J. Okafor' — 表格中仅显示首字母缩写),状态涵盖 paid/packed/shipped/refunded,总额由条目计算得出,下单标签为静态相对文本('2h ago'、'1d ago' … '9d ago')。系列:30 个营收数据点,介于 $310 和 $1,840 之间,具有可信的每周节奏。概览文案:'Revenue, last 30 days' / 'Orders' / 'Average order' / 'Units sold' 作为四个 KPI;热销产品标题为 'What moved';最近订单标题为 'Latest';库存视图在存在三个警报时以 'Three things need you' 问候,否则显示计数行。
   布局:不适用
   动效:不适用
2. **侧边栏** — 字标区块:'[SHOP]'(Instrument 600 17px)位于 'STORE ADMIN'(10px 大写 Soft Ink)上方。ViewButtons 带 lucide 图标:Overview(LayoutDashboard)、Orders(Receipt)、Products(Package)、Inventory(AlertTriangle)。页脚区块:'orders@' + emailDomain 以及折叠状态提示。折叠切换按钮(PanelIcon)位于底部;状态持久化。
   布局:固定左侧,全高,Panel 填充,Line 右边框;展开 232px / 收起 64px 轨道,标签隐藏。
3. **顶栏** — 左侧:当前视图名称(600 16px)和一行商店简介 'Small shop, [NICHE]'(13px Soft Ink)。右侧:一个 'Reseed demo data' 幽灵按钮(RotateCcw 图标)及其确认弹出框,以及一个 Good 状态圆点 'Synced locally',提示为 'Demo data lives in this browser'。搜索框仅存在于 Orders 视图中。
   布局:在内容区内粘性定位,高 64px,Panel 填充,Line 底边框,两侧内边距 32px。
4. **概览视图** — 四个 KpiCards(Revenue $28,412 +12.4% / Orders 412 +6.1% / Average order $68.96 −1.8% / Units sold 638 +9.3% — 来自系列的示例数据):标签(12.5px Soft Ink)、数值(JetBrains 600 28px)、带箭头的 Delta 芯片(Mint 上升 / Ruby 下降)。下方为 2:1 网格:RevenueChart(标题 'Revenue, last 30 days',SVG 面积图,等宽轴标签每第 5 个数据点,说明文字 'Sample series — reseed for a different week')和 TopProducts(五个 BarRow 条目:名称、数量、按最大值缩放的条形、价格)。RecentOrders:一个紧凑的 5 行表格(订单 id 等宽字体、客户首字母圆点、条目数、状态芯片、总额),链接到 Orders 并打开抽屉。
   布局:网格:KPI 4 列 20px 间距(低于 1100px 时 2 列,低于 640px 时 1 列);图表:产品 2:1(低于 1100px 时堆叠);最近订单全宽 Panel。
5. **订单视图** — 工具栏:搜索输入框(高 38px,'Search id or customer')、状态标签页(All / Paid / Packed / Shipped / Refunded)作为带计数的胶囊芯片,以及实时结果计数('Showing 12 of 12')。OrdersTable:列 Order(等宽 id)、Customer(首字母圆点 + 姓名)、Items(计数 + 首个产品名称)、Status(StatusChip)、Total(等宽,右对齐)。行点击打开 OrderDrawer:头部(id、客户、下单标签)、LineItems 带 MonogramTile + 数量 + 行总额、小计/运费/总计行、Timeline(placed → paid → packed → shipped,当前项点亮),以及一个主推进按钮('Mark as packed' 等;已退款订单显示 'Refund logged' 且无按钮)。空状态:'Nothing matches — even the spreadsheet is embarrassed.'
   布局:全宽 Panel;工具栏行位于表格上方;抽屉覆盖在遮罩层上。
6. **产品视图** — 左侧:产品列表行(MonogramTile、名称、sku 等宽、价格、库存,相关时带 low/out 芯片、状态)。行点击或 'Edit' 打开 ProductEditor 抽屉;'New product' 主按钮启动空白编辑器。编辑器:名称、sku(等宽,新建时预填 th-7xx)、价格(数字,已验证)、库存(数字)、状态(active/hidden 下拉选择);失焦时内联验证;Save 写入,toast 'Saved — [name] updated'(或 'added'),列表即时反映。缺货行带有 Ruby 芯片且仍可编辑。
   布局:列表最大宽度 880px;编辑器为右侧抽屉(宽度 420px)。
7. **库存视图** — 标题行:'Alerts' 及计数。AlertRows 用于库存 ≤ 7:MonogramTile、名称、sku、当前库存(为 0 时 Ruby,否则 Amber)、RestockStepper(+1/+5/×2 快捷芯片和数字输入框),以及 'Restock' 应用更改:单元格闪烁 Mint,toast 确认 'Restocked [name] +N',当库存 > 7 时该行离开列表。一行低调的页脚文字:'Restocks are demo-only — no suppliers were contacted.'
   布局:警报行位于 Panel 列表中,最大宽度 880px;标题行高 48px。

## 资产(Assets)
- 图片(image):不使用照片或下载的图片:MonogramTiles、首字母圆点、图表和 favicon 均以代码绘制。不要获取或热链任何内容。
- 图片(image):在项目根目录写入 ASSETS.md,列出代码绘制的资产(字母组合方块、首字母圆点、营收图表、favicon——“drawn in code, original”)以及 npm 包:@fontsource-variable/instrument-sans 和 @fontsource/jetbrains-mono(OFL-1.1)以及 lucide-react(ISC)。
- 图标(icon):仅使用 lucide-react:AlertTriangle、ArrowDownRight、ArrowUpRight、ChevronRight、LayoutDashboard、Package、Receipt、RotateCcw、Search、X。描边宽度 1.75,16–20px,颜色继承。public/favicon.svg:viewBox 0 0 32 32,一个 32x32 的圆角方块,填充 #4F46E5,三条宽度递减的白色水平条(一个低调的条形图符号)。不使用品牌标志。
- 字体(font):安装 @fontsource-variable/instrument-sans 和 @fontsource/jetbrains-mono,并按 Setup 中所述在 src/fonts.ts 中导入它们。Vite 会将 woff2 文件打包进 dist/。

## 禁止事项(Don'ts)
- 无后端、无表单提交、无对 API 的 fetch 请求:所有变更操作都写入 localStorage 中对应 store 键下,在需要如实说明的地方标注 'demo';重新播种(reseed)会恢复原始示例数据。
- 每个内部链接都指向文件名或应用内视图(./index.html、四个侧边栏视图)——绝不指向裸目录;整个站点只有一个页面。
- 不使用真实商店、市场平台、分析或支付品牌(Shopify、Stripe、Meta、GA);商店、产品、订单和客户均为虚构的示例数据。
- 不使用图表或表格库:营收图表为手写 SVG,表格为语义化 <table>。
- 不根据真实时钟渲染日期:展示位置的标签为静态示例文本('2h ago'),图表坐标轴显示示例日期标签,任何地方都不打印今天的日期或年份。
- 不使用照片、人物、头像;仅使用首字母圆点和字母组合方块。
- 一切资源自托管:字体通过 Fontsource,图标以 npm 包或内联 SVG 形式引入。不使用 CDN <script> 或 <link> 标签,不使用 Google Fonts,不使用分析工具。
- 生产构建:压缩、无 source map、不将 src/ 复制进 dist/、使用单条命令 npm run build、输出位于 dist/ 且小于 4 MB。
- 除侧边栏页脚中链接到 https://vibefather.ai 的署名行 'Built with a VibeFather template' 外,站点内绝不提及 VibeFather。
- 遵循 prefers-reduced-motion:不做数字滚动计数、不做图表揭示动画、不做行淡入;抽屉仍保持可用。
- 应用必须在 1440x900 桌面端和 390x844 移动端正常工作(900px 以下侧边栏变为底部图标栏),且控制台零报错;表格、抽屉、步进器和表单仅用键盘即可操作,并具有可见的焦点环。
- 无障碍:抽屉会捕获焦点并可通过 Escape 关闭;状态标签携带文本(绝不单靠颜色);表格使用真实的 th scope;toast 使用 aria-live polite。

---
— Prompt by VibeFather · https://vibefather.ai/t/e-commerce-admin-dashboard · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

个人项目可免费使用(CC BY-NC 4.0)。 商业用途需要 Pro.

DESIGN.md

单独的设计规范:配色、字体、间距和动效。可以把这套视觉用到你已有的项目上。

---
name: "E-commerce Admin Dashboard"
colors:
  ground: "#F4F5F7"
  panel: "#FFFFFF"
  panel_2: "#F7F8FA"
  line: "#E3E5EA"
  ink: "#171A20"
  soft_ink: "#5F6570"
  indigo: "#4F46E5"
  indigo_deep: "#3B34B8"
  indigo_mist: "#EEEDFC"
  mint: "#2F9E6E"
  amber: "#C77E1D"
  ruby: "#C24141"
  slate_ink: "#12131A"
  good: "#2F9E6E"
typography:
  text_and_display_headings_labels_table_text_instrument_sans_workaday_grotesque: { family: "Instrument Sans", weights: [400, 500, 600] }
  mono_money_skus_order_ids_axis_labels_tabular_everywhere: { family: "JetBrains Mono", weights: [400, 500] }
spacing: "8px base unit. Shell: fixed sidebar 232px (collapses to 64px icon rail with a toggle, remembered in localStorage), content max-width 1480px with 32px padding (20px under 900px). Panels: 20px inner padding, 10px radius, 1px Line border. View header rows 48px tall. Table rows 52px, 12px cell padding, mono numerals right-aligned. Type scale: view titles 24px 600; KPI figures JetBrains 600 28px tabular; table and body 14px / 1.5; captions 12.5px Soft Ink; sidebar items 14px 500 with 36px rows. Buttons: height 38px, Instrument 600 13.5px; primary Indigo fill with white text, ghost 1px Line border. Inputs: height 38px, Panel fill, 1px Line border, focus Indigo border + 2px offset ring. Focus everywhere: 2px Indigo outline, 3px offset."
radius: "10px on panels and drawers; 8px on buttons, inputs, chips; 999px for status chips and toasts."
---

# E-commerce Admin Dashboard — Design System

Apply this design system to an existing project. It describes the look and feel only; for the full site, use prompt.md.

## Colors
- **Ground** `#F4F5F7` — App background.
- **Panel** `#FFFFFF` — Cards, table, drawer, sidebar.
- **Panel 2** `#F7F8FA` — Table header rows, hover fill, sidebar footer.
- **Line** `#E3E5EA` — 1px hairlines: borders, table rows, dividers.
- **Ink** `#171A20` — Headings, body, icons.
- **Soft Ink** `#5F6570` — Secondary text, captions, axis labels.
- **Indigo** `#4F46E5` — The one accent: active nav, links, primary buttons, chart line, focus ring, selected rows.
- **Indigo Deep** `#3B34B8` — Hover and pressed primary.
- **Indigo Mist** `#EEEDFC` — Selected fills, chip backgrounds, chart gradient base.
- **Mint** `#2F9E6E` — Positive deltas, paid/packed/shipped chips, success toasts.
- **Amber** `#C77E1D` — Pending chips, restock hints.
- **Ruby** `#C24141` — Refunded chips, validation errors, overdue alerts.
- **Slate Ink** `#12131A` — Text on indigo fills.
- **Good** `#2F9E6E` — Alias kept for success semantics.

## Typography
- **Text and display: headings, labels, table text — Instrument Sans, workaday grotesque** — Instrument Sans (OFL), weights 400/500/600. Self-host the font files.
- **Mono: money, SKUs, order ids, axis labels — tabular everywhere** — JetBrains Mono (OFL), weights 400/500. Self-host the font files.

## Spacing & shape
- Spacing: 8px base unit. Shell: fixed sidebar 232px (collapses to 64px icon rail with a toggle, remembered in localStorage), content max-width 1480px with 32px padding (20px under 900px). Panels: 20px inner padding, 10px radius, 1px Line border. View header rows 48px tall. Table rows 52px, 12px cell padding, mono numerals right-aligned. Type scale: view titles 24px 600; KPI figures JetBrains 600 28px tabular; table and body 14px / 1.5; captions 12.5px Soft Ink; sidebar items 14px 500 with 36px rows. Buttons: height 38px, Instrument 600 13.5px; primary Indigo fill with white text, ghost 1px Line border. Inputs: height 38px, Panel fill, 1px Line border, focus Indigo border + 2px offset ring. Focus everywhere: 2px Indigo outline, 3px offset.
- Radius: 10px on panels and drawers; 8px on buttons, inputs, chips; 999px for status chips and toasts.

## Motion
- Easing: --ease-io cubic-bezier(0.65, 0, 0.35, 1) for drawers; --ease-out cubic-bezier(0.22, 0.61, 0.36, 1) for the rest. Office-hours quick: nothing over 320ms.
- View swap: panels fade 6px up over 240ms; the sidebar's active item swaps a 2px Indigo rail instantly.
- KPI deltas: the arrows and +/− colors set immediately; figures count to value over 500ms on first view of Overview.
- RevenueChart: the area path draws once on view (clip-path reveal 700ms); the crosshair bubble follows pointer with no easing lag.
- Orders table: filter changes reflow with a 140ms fade on rows (no layout animation); the selected row holds an Indigo Mist fill.
- OrderDrawer / editor panel: slide 320ms --ease-io with a Line-left border and soft shadow; scrim at 24% Ink.
- Toasts: rise 8px and fade in 180ms, auto-dismiss 2.8s with a thin progress bar, exit fade 160ms.
- Restock steppers: qty changes pop the figure 1→1.15→1 (120ms); the stock cell flashes Mint once.
- prefers-reduced-motion: reduce — no counting, no chart reveal (final state), no row fades; drawers still slide (they are navigation, capped at 150ms) or fade if the UA prefers. Use CSS @media in index.css plus Motion's useReducedMotion.

## Imagery
No photographs, no logos, no avatars: products render as MonogramTiles (two-letter tiles on Indigo Mist with Ink initials), orders carry customer initials dots, and every chart is inline SVG. Icons: lucide-react only, stroke width 1.75. The favicon is drawn SVG.

## Tone
Back-office calm: exact numbers, short labels, no motivational copy. One dry joke in the empty-state row.

---
— Prompt by VibeFather · https://vibefather.ai/t/e-commerce-admin-dashboard · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

改成你自己的

  • 蜡烛工作室主理人:把 [SHOP] 设为你的工作室名称,[NICHE] 设为蜡烛和家居香氛,然后改写商品名称、SKU 和订单条目以匹配你的商品目录。
  • 咖啡烘焙商处理订单:保留订单表格和详情抽屉,重命名状态标签以匹配你的履约步骤,并调整时间线标签。
  • 关注库存的小型服装品牌:把库存视图的低库存预警行和补货步进器当作每日补货清单,按商品设置阈值。
  • 展示内部工具的开发者:保留虚构数据,把顶栏重置按钮指向你自己的示例数据集,并把概览 KPI 作为演示的开场屏幕。

电商管理后台:常见问题

在电商管理后台模板里,我实际能做哪些操作?

电商管理后台模板是一个带四个侧边栏视图的单页管理应用。概览展示四张带涨跌幅的 KPI 卡片、30 天营收面积图、热销商品条形列表和最近订单。订单是一个密集表格,带状态标签、文本搜索和筛选标签页,点击行会打开详情抽屉,内含订单明细和状态时间线。商品视图包含列表和编辑表单,库存视图展示低库存预警和补货步进器。

电商管理后台模板免费吗?Pro 能获得什么?

电商管理后台模板是免费的。其提示词和 DESIGN.md 在 CC BY-NC 4.0 下可免费用于个人非商业用途。商业或客户项目需要 Pro,Pro 提供完整提示词和演示源代码。免费模板会公开展示简介、技术栈和变量,方便你在决定前了解结构。

怎么用 AI 做一个电商管理后台?

复制本页的提示词,或者运行 npx vibefather add e-commerce-admin-dashboard,把 [SHOP]、[NICHE] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。