企业级组件系统 · 新资源

Prime UI 设计系统.

一个版本固定的 PrimeVue 实现,属于 Prime UI 生态系统:采用 Aura 主题的文档树,包含真实的预设引用、受控展开、筛选、选择和本地固定功能。

OpenDesign 指南9 个章节51 个参考条目原始应用指南
01

Prime UI 设计系统界面预览

筛选层级问题,选择文档,展开或折叠文件夹,并固定本地参考内容。

编辑文档库打开完整示例
使用 PrimeVue 4.5.5、Vue 3 和 @primeuix/themes 1.2.5 Aura。这是针对 Vue 的具体实现,并非跨框架软件包。· 实现参考
02

Prime UI 设计系统设计参考

此 Prime UI 资源采用 PrimeVue 4.5.5 和 @primeuix/themes 1.2.5 Aura 实现,并未声称它是可在 PrimeVue、PrimeReact 和 PrimeNG 之间通用的 API。相关值根据已安装的预设进行检查。本页面将根字号设为 16px;rem 尺寸按这一明确设置进行解释。

Aura 翡翠色基础色

来源
名称 / 规则值 / 配置用途
primitive.emerald.50#ecfdf5 默认主色阶实际使用的基础色。
primitive.emerald.100#d1fae5 默认主色阶实际使用的基础色。
primitive.emerald.200#a7f3d0 默认主色阶实际使用的基础色。
primitive.emerald.300#6ee7b7 默认主色阶实际使用的基础色。
primitive.emerald.400#34d399 默认主色阶实际使用的基础色。
primitive.emerald.500#10b981 默认主色阶实际使用的基础色。
primitive.emerald.600#059669 默认主色阶实际使用的基础色。
primitive.emerald.700#047857 默认主色阶实际使用的基础色。
primitive.emerald.800#065f46 默认主色阶实际使用的基础色。
primitive.emerald.900#064e3b 默认主色阶实际使用的基础色。
primitive.emerald.950#022c22 默认主色阶实际使用的基础色。

Aura 浅色语义角色

来源
名称 / 规则值 / 配置用途
semantic.colorScheme.light.primary.color{primary.500}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.primary.contrastColor#ffffff Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.primary.hoverColor{primary.600}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.primary.activeColor{primary.700}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.highlight.background{primary.50}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.highlight.focusBackground{primary.100}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.highlight.color{primary.700}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.highlight.focusColor{primary.800}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.text.color{surface.700}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.text.hoverColor{surface.800}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.text.mutedColor{surface.500}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.colorScheme.light.text.hoverMutedColor{surface.600}Aura 预设中的实际值;花括号保留了令牌引用。

Aura 圆角和字段间距

来源
名称 / 规则值 / 配置用途
primitive.borderRadius.none0Aura 预设中的实际值;花括号保留了令牌引用。
primitive.borderRadius.xs2pxAura 预设中的实际值;花括号保留了令牌引用。
primitive.borderRadius.sm4pxAura 预设中的实际值;花括号保留了令牌引用。
primitive.borderRadius.md6pxAura 预设中的实际值;花括号保留了令牌引用。
primitive.borderRadius.lg8pxAura 预设中的实际值;花括号保留了令牌引用。
primitive.borderRadius.xl12pxAura 预设中的实际值;花括号保留了令牌引用。
semantic.formField.paddingX0.75rem实际共用的字段内边距或圆角引用。
semantic.formField.paddingY0.5rem实际共用的字段内边距或圆角引用。
semantic.formField.borderRadius{border.radius.md}实际共用的字段内边距或圆角引用。
semantic.focusRing.width1pxAura 预设中的实际值;花括号保留了令牌引用。
semantic.focusRing.stylesolidAura 预设中的实际值;花括号保留了令牌引用。
semantic.focusRing.color{primary.color}Aura 预设中的实际值;花括号保留了令牌引用。
semantic.focusRing.offset2pxAura 预设中的实际值;花括号保留了令牌引用。
semantic.focusRing.shadownoneAura 预设中的实际值;花括号保留了令牌引用。

原生 Tree 几何尺寸

来源
名称 / 规则值 / 配置用途
components.tree.root.padding1remTree 根节点布局的实际值。
components.tree.root.gap2pxTree 根节点布局的实际值。
components.tree.root.indent1remTree 根节点布局的实际值。
components.tree.node.padding0.25rem 0.5rem实际的节点间距或选中状态角色。
components.tree.node.gap0.25rem实际的节点间距或选中状态角色。
components.tree.node.selectedBackground{highlight.background}实际的节点间距或选中状态角色。
components.tree.node.selectedColor{highlight.color}实际的节点间距或选中状态角色。
components.tree.nodeToggleButton.size1.75rem原生展开控件的目标尺寸。

显式应用类型和间距

来源
名称 / 规则值 / 配置用途
Root font size16px此示例原本明确设置的基准值。
Font familysystem-ui, sans-serif页面原始字体;并非从 Aura 下载的字体。
Page heading34px / 1.15; 29px mobile原始编辑层级。
Detail body15px / 1.7原始文档阅读样式。
Sidebar / gap340px / 24px原始桌面布局。
Mobile breakpoint760px原始堆叠布局断点。
03

Prime UI 设计系统完整指南

实用指南,介绍如何为真实界面选择、应用和评审此系统。

DESIGN-prime-ui.md

完整指导、实现起点和源代码链接。

下载指南

Prime UI 设计系统是一个生态系统,而非单个导入项

Prime UI 是一个生态系统,而非单个导入项

PrimeTek 的 UI 生态系统包含面向不同框架的实现。本页面选用其中一个具体方案:PrimeVue 4.5.5、Vue 3,以及来自 @primeuix/themes 1.2.5 的 Aura 预设。完整入口文件、导入语句和组件示例均适用于这一 Vue 配置。React 或 Angular 项目需要使用对应的软件包和 API,而不能直接照搬这些 Vue 标签。

摘自本 OpenDesign 指南

在这里,锁定版本至关重要。已安装的 4.5.5 软件包采用 MIT 许可证,经过验证的本地示例无需许可证密钥即可运行。对较新 5.0.2 运行时的测试显示了 PrimeUI 许可证错误,因此本示例特意不提供未注明版本的最新版安装命令,也不暗示不同版本的授权条款完全相同。

阅读配套规范

Prime UI 设计系统基础、语义和组件令牌构成一条链

基础、语义和组件令牌构成一条链

Aura 将原始颜色基础值与语义角色和组件值区分开来。默认主色阶引用翡翠色基础值。在浅色模式下,primary.color 引用 primary.500,hoverColor 引用 primary.600,activeColor 则引用 primary.700。高亮角色采用更浅的主色背景表面和更深的前景色来呈现选中状态。

随后,Tree 会将选中背景和文本映射到高亮角色,而不是硬编码另一种无关的绿色。规范保留了花括号引用,因为引用关系能说明主题变更是如何传递的。将每个别名替换为独立的十六进制值,会掩盖这一有用的依赖关系。

阅读配套规范

Prime UI 设计系统从匹配的预设中读取值

从匹配的预设中读取值

在锁定版本的 Aura 预设中,Tree 根节点的内边距和缩进均为 1rem,节点内边距为 0.25rem 0.5rem,切换按钮尺寸为 1.75rem。示例将 html 根字号固定为 16px,因此这些尺寸都有明确的实际值。即使组件标记看起来相似,不同预设版本或根字号也可能导致密度不同。

圆角基础值从零到二、四、六、八和十二像素不等。字段的通用内边距为水平方向 0.75rem、垂直方向 0.5rem。页面的三十四像素标题、系统字体和二十四像素列间距,都是原始布局设定,不属于原生组件主题。

阅读配套规范

Prime UI 设计系统:节点键让展开与选择保持稳定

节点键让展开与选择保持稳定

树形结构包含一个刊期、三个文件夹和六个文档叶节点。每个节点都有稳定的键和标签。文件夹节点设置 selectable:false,因此它们只用于组织层级,不会被误认为是可阅读的文档。expandedKeys 模型控制打开的文件夹;“展开”和“折叠”操作会有意替换该映射。

单选通过 selectionKeys 和 node-select 处理程序实现。只有在文档记录映射中找到对应键时,才会更新详情面板。重命名可见标签不需要更改节点标识;折叠文件夹也不会清除当前选中的文档或其固定状态。

阅读配套规范

Prime UI 设计系统:原生筛选保留匹配项的上下文

原生筛选会保留匹配项的上下文

Tree 启用内置筛选,filterMode 设为 lenient,并显示“查找文档”占位文本。搜索“地图”时,显示的层级会缩小至匹配文档及其祖先节点。读者仍能了解搜索结果所属的位置,而不会只看到一组互不相关的扁平建议。

清除筛选条件后,层级结构会恢复。筛选不会改写源节点,也不会移除已固定的文档。详情面板会保留上次明确选中的叶节点,避免内容随着每次按键而意外变化。较大的文档集合可能需要延迟加载数据,但这个完整示例使用六条本地记录,不代表具备服务器端搜索功能。

  1. 搜索“地图”,并查看保留的刊期和文件夹上下文。
  2. 选择“三幅区域地图”,更新文档面板。
  3. 清除筛选条件,并确认所选文档仍显示在层级结构中。

阅读配套规范

Prime UI 设计系统:为所选文档提供独特且实用的内容

选中的文档需要明确且实用的内容

每份文档都包含类型、负责人、状态、简介、检查清单和具体说明。文章会要求检查内容顺序和图注;地图参考资料会要求统一方位并确保比例尺独立;校样清单则会询问文字是否清晰易读、裁切是否合适。选择不同文档时,显示的内容也会随之变化,而不是在六个标题下重复同一段文字。

状态标签仅作为描述性示例元数据,不会触发外部发布流程。等高线插图是原创装饰图形;在相关位置会明确标注其装饰用途。它并非地理地图,不应被当作地图解读。

阅读配套规范

Prime UI 设计系统:固定状态独立于树模型

固定状态独立于树模型

点击“固定此文档”会将当前文档键添加到本地数组。文档固定后,按钮会变为“已固定”并禁用,以防重复添加。移除已固定的条目时,只会删除对应的键,不会影响树中的选择。固定数量由该数组计算得出。

将这些状态分开很重要,因为选择、展开和保存引用分别用于解决不同任务。用户可以折叠所有文件夹,同时保持一篇已选文章处于打开状态;也可以筛选至刊期的其他部分,而不丢失已固定的引用。这些操作都不意味着远程文档已被编辑。

阅读配套规范

Prime UI 设计系统:保留原生树形控件的键盘操作模式

保留原生树形控件的键盘操作模式

原生 Tree 通过 tree 和 treeitem 角色、选择与展开属性,以及嵌套层级之间的关系来呈现层级结构。其键盘操作模式使用方向键在可见节点间移动并展开或折叠分支,使用 Enter 或空格键选择获得焦点的节点。此页面为文档集合提供了清晰的 aria-label。

详情面板和固定列表使用常规标题、列表及带名称的按钮。在移动设备上,导航器的朗读顺序位于文档之前。布局会在原有的 760px 断点处改为纵向堆叠,既不会裁切树形控件,也不会隐藏文档说明;状态栏会报告当前选择。

  • 可见树顺序发生变化时,使用稳定的键。
  • 文件夹没有关联的详情内容时,应将其设为不可选择。
  • 为“移除”按钮提供具体的文档名称,避免所有按钮都使用含义模糊的相同标签。

阅读配套规范

Prime UI 设计系统:在 Vue 根节点注册主题一次

在 Vue 根节点处注册主题一次

入口文件从 primevue/config 导入 PrimeVue,从 @primeuix/themes/aura 导入 Aura,并导入完整的 App.vue。通过设置 theme.preset 为 Aura 来注册插件。在此固定的浅色示例中,darkModeSelector 为 false;生产环境中的主题切换应使用对应版本支持的选项进行配置,不要混用较新主版本的文档。

PrimeVue 的样式化组件会根据预设生成所需的组件样式。提供的 style.css 仅定义原始页面布局和插图。未使用旧版 primevue/resources/theme.css 导入方式。经过验证的设置可以选择树的叶节点、固定该节点、筛选层级,并在 390px 视口下渲染,且不会出现无效许可证提示。

阅读配套规范

Prime UI 设计系统:组件示例

完整的原生树形控件和详情视图

稳定的节点键、受控的 expanded 和 selection 映射、筛选处理及 node-select 处理。

vue
<script setup>
import {ref,computed} from 'vue';import Tree from 'primevue/tree';import Button from 'primevue/button';import Tag from 'primevue/tag';
const nodes=[{key:'issue',label:'Issue 04 · Fieldwork',selectable:false,children:[{key:'essays',label:'Essays',selectable:false,children:[{key:'ridge',label:'The ridge path'},{key:'river',label:'A river after rain'}]},{key:'visuals',label:'Visual material',selectable:false,children:[{key:'maps',label:'Three regional maps'},{key:'captions',label:'Caption reference sheet'}]},{key:'production',label:'Production',selectable:false,children:[{key:'proof',label:'Print proof checklist'},{key:'credits',label:'Credits and permissions'}]}]}];
const documents={ridge:{type:'Essay',owner:'Alex Morgan',status:'Editing',title:'The ridge path',intro:'A field essay about following the contour rather than the shortest route.',items:['Opening: the first view above the tree line','Middle: how a contour changes the pace of walking','Close: the landmarks remembered on the return'],note:'Review the transition between the weather observation and the first-person account.'},river:{type:'Essay',owner:'Jules Chen',status:'Review',title:'A river after rain',intro:'An observational essay that follows sediment, sound and changing water levels.',items:['Keep the time sequence explicit','Pair each field image with an observation','Check the final geographic names'],note:'Compare the image captions with the text before locking the layout.'},maps:{type:'Visual reference',owner:'Sam Rivera',status:'Review',title:'Three regional maps',intro:'A consistent reference treatment for ridge, river and open plain.',items:['Same north orientation','Shared legend and label size','Scale shown independently on each map'],note:'The miniature map below is original decorative geometry, not a geographic claim.'},captions:{type:'Reference',owner:'Maya Patel',status:'Editing',title:'Caption reference sheet',intro:'One place to keep subject, location, credit and contextual description.',items:['Subject and date','Location at an appropriate level of precision','Author or source credit'],note:'Do not use the visible caption as a substitute for a useful image alt description.'},proof:{type:'Checklist',owner:'Alex Morgan',status:'Ready',title:'Print proof checklist',intro:'Review the physical proof at actual scale before choosing the final stock.',items:['Body text and small labels remain legible','Images preserve the intended tonal range','Trim and page sequence match the layout'],note:'This is a sample editorial workflow, not a print vendor specification.'},credits:{type:'Reference',owner:'Maya Patel',status:'Review',title:'Credits and permissions',intro:'Keep attribution close to each asset record so it survives layout changes.',items:['Creator name and source','Allowed uses recorded separately','Credit wording copied accurately'],note:'This sample does not provide legal permission for any external image.'}};
const expanded=ref({issue:true,essays:true,visuals:true,production:true}),selection=ref({'ridge':true}),current=ref('ridge'),saved=ref([]);const doc=computed(()=>documents[current.value]);function select(node){if(documents[node.key])current.value=node.key;}function pin(){if(!saved.value.includes(current.value))saved.value.push(current.value);}function expandAll(){expanded.value={issue:true,essays:true,visuals:true,production:true};}
</script>
<template><main class="editorial-library"><header><div><p class="eyebrow">PRIME UI · PRIMEVUE IMPLEMENTATION</p><h1>Find the thread of an issue.</h1><p class="intro">A native tree navigator for an editorial collection, using the Aura theme.</p></div><Tag value="Local specimen" severity="secondary" /></header><div class="library-layout"><aside class="library-nav"><div class="nav-heading"><h2>Issue contents</h2><div><Button label="Expand" text size="small" @click="expandAll"/><Button label="Collapse" text size="small" @click="expanded={}"/></div></div><Tree :value="nodes" v-model:expandedKeys="expanded" v-model:selectionKeys="selection" selectionMode="single" :filter="true" filterMode="lenient" filterPlaceholder="Find a document" aria-label="Editorial document tree" @node-select="select" /><section class="pinned"><h2>Pinned documents <span>{{saved.length}}</span></h2><ul v-if="saved.length"><li v-for="key in saved" :key="key"><span>{{documents[key].title}}</span><Button label="Remove" text size="small" :aria-label="`Remove ${documents[key].title}`" @click="saved=saved.filter(x=>x!==key)"/></li></ul><p v-else>No documents pinned yet.</p></section></aside><article class="document"><div class="document-top"><span>{{doc.type}}</span><Tag :value="doc.status" :severity="doc.status==='Ready'?'success':doc.status==='Review'?'info':'warn'"/></div><h2>{{doc.title}}</h2><p class="owner">{{doc.owner}} · ISSUE 04</p><div class="map-art" aria-hidden="true"><i></i><i></i><i></i><span>FIELD NOTES / 04</span></div><p class="intro">{{doc.intro}}</p><h3>What to inspect</h3><ol><li v-for="item in doc.items" :key="item">{{item}}</li></ol><aside class="document-note">{{doc.note}}</aside><Button :label="saved.includes(current)?'Pinned':'Pin this document'" :disabled="saved.includes(current)" @click="pin"/><p class="local-note">Sample records only. Pinning changes this page’s local state.</p></article></div><p class="selection-status" role="status">Selected document: {{doc.title}}</p></main></template>

代码参考

  • 文件夹节点设置 selectable:false;只有文档叶节点会更改详情视图。
  • 原生筛选采用 lenient 模式,并保留匹配项的层级结构。
  • 固定的文档属于独立的应用状态。

原创编辑式布局

围绕 Aura 风格原生组件构建的响应式文档导航器。

css
*{box-sizing:border-box}html{font-size:16px}body{margin:0;background:#f4f6f4;color:#26342d;font-family:system-ui,sans-serif}.editorial-library{max-width:1120px;padding:32px;margin:auto}header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:32px}.eyebrow{font-size:11px;letter-spacing:.12em;font-weight:700;color:#5f7566}h1{font-size:34px;line-height:1.15;margin:14px 0}.intro{font-size:15px;line-height:1.7;color:#5f6b63}.library-layout{display:grid;grid-template-columns:340px 1fr;gap:24px}.library-nav,.document{background:white;border:1px solid #dfe5df;border-radius:12px;min-width:0}.nav-heading{padding:18px 18px 0}.nav-heading h2,.pinned h2{font-size:15px;margin:0 0 8px}.nav-heading>div{display:flex;gap:4px}.pinned{border-top:1px solid #dfe5df;padding:20px}.pinned h2{display:flex;justify-content:space-between}.pinned p{font-size:13px;color:#6a766e}.pinned ul{list-style:none;padding:0;margin:0}.pinned li{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;padding:8px 0}.document{padding:28px}.document-top{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#617265}.document h2{font-size:28px;line-height:1.2;margin:16px 0 8px}.owner{font-size:11px;letter-spacing:.08em;color:#6a766e}.map-art{height:130px;background:#dae4d4;border-radius:6px;position:relative;overflow:hidden;margin:24px 0}.map-art i{position:absolute;width:300px;height:130px;border:1px solid #63845a;opacity:.55;border-radius:50%;left:10%;top:30%;transform:rotate(-20deg)}.map-art i:nth-child(2){width:240px;height:100px;top:42%;left:16%}.map-art i:nth-child(3){width:180px;height:70px;top:54%;left:22%}.map-art span{position:absolute;top:16px;left:18px;font-size:9px;font-weight:700;letter-spacing:.16em;color:#496342}.document h3{font-size:15px;margin-top:24px}.document ol{padding-left:21px;font-size:14px;line-height:1.7}.document li{margin:10px 0}.document-note{border-left:3px solid #8aad88;background:#f1f5ee;padding:12px 16px;font-size:13px;line-height:1.7;margin:24px 0}.local-note,.selection-status{font-size:12px;color:#6a766e;line-height:1.6}.selection-status{margin-top:20px}@media(max-width:760px){.editorial-library{padding:24px 14px}header{flex-direction:column;gap:6px}h1{font-size:29px}.library-layout{grid-template-columns:1fr}.document{padding:22px}}

代码参考

  • 等高线插图是原创装饰图形,并非真实地图。
  • 根字号明确设为 16px,以确保 rem 尺寸可复现。
04

Prime UI 设计系统:Agent 设置

实现起点

已验证 PrimeVue 4.5.5 与 @primeuix/themes 1.2.5。已安装的 PrimeVue 4 软件包采用 MIT 许可证。请勿假定其他主版本具有相同的设置方式或许可要求。

javascript
// Create the project first:
// npm create vite@latest prime-ui-specimen -- --template vue
// cd prime-ui-specimen && npm install
// In a Vite Vue 3 project:
// npm install [email protected] @primeuix/[email protected]
// Save the complete SFC as App.vue and layout as style.css.
import {createApp} from 'vue';
import PrimeVue from 'primevue/config';
import Aura from '@primeuix/themes/aura';
import App from './App.vue';
import './style.css';
createApp(App).use(PrimeVue, {
  theme: {preset: Aura, options: {darkModeSelector: false}}
}).mount('#app');
// index.html contains <div id="app"></div>.
// This example is pinned to 4.5.5, not the newer 5.x runtime.
// Keep the template index.html and replace its entry with the code above.
// npm run dev

适用于你项目的提示词

Agent 提示词
基于提供的 PrimeVue 4.5.5 编辑文档库和 @primeuix/themes 1.2.5 中匹配的 Aura 预设构建。保留 Tree 原生的展开、筛选和选择功能,并使用稳定的节点键;选中的文档详情应与已固定文档列表明确区分。固定和取消固定实际文档,不要将类别节点当作文档,也不要重复固定项。保留完整的 provider 配置和原始响应式 CSS。这是经过验证的第四版示例;请勿悄然替换为更新的主版本运行时,也不要将其改造成采购工作流。
05

Prime UI 设计系统来源与范围

Prime UI 生态系统,具体使用 PrimeVue 4.5.5 和 Aura 1.2.5 实现。本页不声称不同框架包或更新主版本之间的 API 或许可要求完全相同。所有记录和固定操作均在本地进行。