Neus 布局 - 着陆页 是做什么的?
生成一个公共页面外壳:固定粘性头部 + 主体 + 页脚。无 AppTemplate,无侧边栏。
开始之前
以下"共享规则"部分始终生效。此外请阅读:
.agents/skills/_shared/anti-slop.md— 强制性质量规则.agents/skills/_shared/prop-constraints.md— 禁止使用的 props 和不存在的组件.agents/skills/_shared/component-catalog.md— Button、Link 组件说明.agents/skills/_shared/theme-config.md— ThemeProvider 配置.agents/skills/_shared/checklist.md— P0/P1/P2 关卡检查.agents/skills/_shared/dark-surfaces.md— 暗色模式 CSS 配方(当模式为暗色时读取).agents/skills/_shared/light-surfaces.md— 浅色模式 CSS 配方(当模式为浅色时读取)
阶段 0 — 收集数据
以自由文本询问:
- 品牌/产品名称(用于头部 Logo)
- 头部导航项(精确链接)
- 头部 CTA 按钮?(按钮文本 — 例如:“免费开始使用”)
- 页脚:链接列或仅版权信息
- 主要主题色
- 主题模式:浅色还是深色?(默认:浅色)
阶段 1 — 视觉解析
在编写任何代码之前,根据收集到的答案解析“视觉指令”(VISUAL DIRECTIVE)。
- 模式:
dark→ 读取dark-surfaces.md;使用深色画布#0a0a14,玻璃导航,玻璃表面 - 模式:
light→ 读取light-surfaces.md;使用var(--color-white)画布,实心白色导航
声明指令:
VISUAL DIRECTIVE
Mode: dark | light
Surface file: dark-surfaces.md | light-surfaces.md
阶段 2 — 生成
按顺序生成 三个文件:LandingLayout.types.ts → LandingLayout.tsx → LandingLayout.styles.css。
LandingLayout.types.ts
export type NavItem = {
label: string;
href: string;
};
export type LandingLayoutProps = {
children: React.ReactNode;
};
LandingLayout.tsx
import { Button, Link, ThemeProvider } from 'neus-ui';
import './LandingLayout.styles.css';
import type { LandingLayoutProps } from './LandingLayout.types';
export const LandingLayout = ({ children }: LandingLayoutProps) => (
<ThemeProvider initialTheme={{ primaryColor: '[从收集数据获取的 hex]' }}>
<div className="landing-layout">
{/* 固定粘性导航头部 */}
<header className="landing-layout__header">
<div className="landing-layout__header-inner">
<span className="landing-layout__brand">[BrandName]</span>
<nav className="landing-layout__nav">
{/* 从收集数据获取的导航项 — 白色头部背景上使用 type="primary" */}
<Link label="[NavItem1]" type="primary" href="#[section]" />
</nav>
<Button label="[Header CTA]" variant="solid" color="primary" onClick={() => {}} />
</div>
</header>
{/* 页面内容 */}
<main className="landing-layout__main">
{children}
</main>
{/* 页脚 */}
<footer className="landing-layout__footer">
<span>[BrandName] © {new Date().getFullYear()}</span>
<div className="landing-layout__footer-links">
<Link label="服务条款" type="secondary" href="/terms" />
<Link label="隐私政策" type="secondary" href="/privacy" />
</div>
</footer>
</div>
</ThemeProvider>
);
LandingLayout.styles.css
应用来自 VISUAL DIRECTIVE 的模式。使用已解析的表面文件中的表面配方。
浅色模式 (Mode: light):
.landing-layout { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-white); }
.landing-layout__header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid var(--color-border-light);
}
.landing-layout__header-inner {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
}
.landing-layout__brand {
font-family: var(--font-display);
font-size: 1.25rem;
font-weight: 700;
color: var(--color-primary);
}
.landing-layout__nav { display: flex; gap: 1.5rem; align-items: center; }
.landing-layout__main { flex: 1; }
.landing-layout__footer {
padding: 1.5rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid var(--color-border-light);
font-size: 0.9rem;
color: var(--color-gray-500);
}
.landing-layout__footer-links { display: flex; gap: 1rem; }
深色模式 (Mode: dark) — 替代浅色模式规则:
.landing-layout { min-height: 100vh; display: flex; flex-direction: column; background: #0a0a14; color: #e2e8f0; }
.landing-layout__header {
position: sticky;
top: 0;
z-index: 100;
background: rgba(10, 10, 20, 0.8);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* (header-inner, brand, nav, main — 与浅色模式相同) */
.landing-layout__brand { color: #818cf8; }
.landing-layout__footer {
padding: 1.5rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid rgba(255, 255, 255, 0.08);
font-size: 0.9rem;
color: #64748b;
}
共享规则(内嵌)
这些规则始终生效。即使
_shared/文件未被读取,它们也适用。
输出 — 始终三个文件
每个技能输出:ComponentName.types.ts → ComponentName.tsx → ComponentName.styles.css。
无内联样式(style={{}})。无 <style> 标签放入组件内部。CSS 仅放于 .styles.css 中。
导入
import { Button, Card, Input, Badge, Link, Select, Modal, DataTable } from 'neus-ui';
切勿从内部路径导入,例如 ../../components/Button/Button。
类型
所有 type / interface 声明 → 放入 ComponentName.types.ts。切勿在 .tsx 中声明类型。
React 19 — 无 FormEvent
切勿 import { FormEvent } from 'react'。改用 <Button type="submit" onClick={...} />。
组件 Prop 约束
- Button
variant:"solid"|"outlined"|"text"—"ghost"不存在 - Button
color:"primary"|"success"|"error"|"info"|"white"—"white"仅用于深色画布 - Button
size:"small"|"medium"|"large" - Card
variant:"default"|"glass"—"glass"用于深色画布 - Badge
color:"primary"|"success"|"error"|"info"|"neutral" - Link
type:"primary"(品牌色) |"secondary"(柔灰) - Select:无
requiredprop — 外部处理验证逻辑 - FormTemplate:仅支持
children、submitLabel、loading— 无onSubmit/onCancel
反模式黑名单
- 无内联样式 /
style={{}}/<style>标签 - 当数据来自 API 时,无硬编码数据数组 — 使用类型化 props
- 无捏造的文案(虚假推荐、占位名称、虚假指标)
- 无
anyTypeScript 类型 - 当存在 Neus UI 组件时,不使用原始
<a>、<span>、<input>、<button> - 无硬编码字体栈 — 使用
var(--font-display)/var(--font-mono) - 深色模式下:不使用
var(--color-primary-light)作为部分背景;不使用原始 div 卡片 — 应使用<Card variant="glass">