@ac-design/design-system

中文文档
2.11.0发布于 2026/11/01TypeScriptES Module近 30 天下载 5029

AppsCode design system: Tailwind CSS v4 theme and Vue 3 components.

原始使用文档
文档目录11 节
  1. What's in it
  2. Components
  3. Look and feel
  4. Using it in an app
  5. Styling rule
  6. In an app with Tailwind v4
  7. In an app with only the old styles
  8. Either way
  9. Scripts
  10. Project layout
  11. Contributing

AppsCode Design System

The design system for every AppsCode console (cloud-ui, cluster-ui, kubedb-ui, platform-ui, billing-ui, selfhost-ui…): a Tailwind CSS v4 theme and Vue 3 components, with a documentation site that shows every component live.

It replaces the old Bulma/SCSS library (@appscode/design-system 2.x). Every component the apps import from the old library has a replacement here, and the docs' Migration page maps the old props to the new ones.

npm install
npm run dev          # docs site at http://localhost:5173

What's in it

Themesrc/lib/theme.css: colour scales, semantic tokens (text, borders, surfaces), type scale, radii, shadows and a full dark theme, as a Tailwind @theme.
Components101 Vue components (counting sub-parts such as AcDropdownItem) in eight groups, listed below.
EditorsAcCodeEditor and AcFileEditor on CodeMirror 6, in the /editor entry so other apps don't bundle CodeMirror.
ChartsSeven charts on Apache ECharts 6 (cloud-ui's engine), in the /charts entry. echarts is an optional peer dependency.
ComposablesuseColorMode() (light/dark/system), useFontScale() (text size), useToast() (notifications), useBrandColor() (re-hue the brand at runtime), useTablePagination() and useApiPagination(), useBulkSelection(), useFormValidation(), and copyText().
LogoAcLogo: the AppsCode logo and mark as inline SVG that follows dark mode.
Docs siteGetting started, foundations, a page per component (live playground, examples, guidelines, accessibility, API tables) and full example pages.

Components

GroupComponents
ElementButton, Button Group, Badge, Tag, Avatar, Alert, Banner, Card, Divider, Kbd, Copy Button, Command Block, Check List
FeedbackSpinner and Preloader, Loader, Skeleton, Progress, Circular Progress, Toast, Empty State, Error State
FormInput, Number Input, Textarea, Code Editor, File Editor, Select, Combobox, Tag Input, CheckBox, CheckRadio, Radio Card, Switch, Switch Card, Search Bar, File Upload, Slider, Date Picker, Month Picker, Color Input, Time Picker, Form, Form Array, Key-Value Input, Taint Input, Theme Mode, Font Scale
OverlayModal, Delete Modal, Confirm Modal, Side Panel, Dropdown, Popover, Tooltip
LayoutPage, Sidebar, Navbar, Header, Product Hero, Content Table, Section Content, Settings Row, Accordion, Status Bar, Footer
NavigationBreadcrumb, Tabs, Steps, Pagination, Locale Switcher, Side Tabs, App Switcher, Cluster Switcher, Notifications
DataTable, Bulk Action Bar, Info Table, List, Cell Value
CardsStat Card, Feature Card, Resource Card, Usage Card, Cost Summary
Charts (/charts)Line Chart, Area Chart, Bar Chart, Donut Chart, Map Chart, Graph Chart, Tree Chart

Example pages put them together: a database list, a database detail page, a create wizard, settings, empty and error states, and a full app shell.

Look and feel

The look and voice are the AppsCode Cloud console's (cloud-ui), so the system fits cloud-ui, kubedb-ui, cluster-ui and platform-ui alike.

  • Type: Roboto for the interface, Google Sans Flex for headings and JetBrains Mono for code and resource names, on a 14px base.
  • Colour: white cards on a #f9fafb page, neutral greys (#252525 text, #5c5c5c descriptions, one #ebebeb border), the #00a651 brand green, and success, info, warning, danger and pending statuses, each with an AA -strong text colour.
  • Shape: 42px buttons and fields with a 10px radius, 14px cards and 16px dialogs. Cards rest on a border; shadows mark only what floats.
  • Focus: a focus-ring utility (primary border and a 2px halo) on form fields, and a 2px offset ring on buttons.
  • Dark mode: class-based. Every token has a dark value, so components need no dark-specific code.
  • Icons: Lucide (@lucide/vue). Components never draw their own SVG icons.

Using it in an app

The package is @ac-design/design-system on npm. npm run build:lib writes it to dist/lib, and npm pack makes an installable tarball.

npm install @ac-design/design-system @lucide/vue
npm install echarts   # only if you use /charts

Styling rule

Style with Tailwind utility classes and the design tokens. Don't write custom CSS: no <style> blocks in components and no one-off class rules. Use arbitrary values (max-w-[320px], bg-[color-mix(in_srgb,var(--color-primary)_6%,var(--color-surface))]) for exact values, and arbitrary variants ([&_.cm-content]:p-2) for markup you don't own. If something truly can't be a utility, add a token or @utility to theme.css. The full rule is in CLAUDE.md.

There are two ways to load the styles:

The app…LoadTailwind in the app
runs Tailwind v4 (cloud-ui, cluster-ui, kubedb-ui, platform-ui and new apps)theme.cssYes
still loads the old Bulma/SCSS design system and has no Tailwindcompat.cssNo

In an app with Tailwind v4

// main.ts: fonts once
import "@fontsource-variable/roboto";
import "@fontsource-variable/google-sans-flex/opsz.css";
import "@fontsource-variable/jetbrains-mono";
/* your main CSS file */
@import "tailwindcss";
@import "@ac-design/design-system/theme.css";

In an app with only the old styles

The docs page Getting Started → Existing Apps has the full guide. In short:

// main.ts (Vite), or the `css` list in nuxt.config.ts: after the old styles
import "./assets/styles/scss/main.scss";
import "@fontsource-variable/roboto";
import "@fontsource-variable/google-sans-flex/opsz.css";
import "@fontsource-variable/jetbrains-mono";
import "@ac-design/design-system/compat.css";
  • compat.css is the library's styles, precompiled and fenced in: they apply only inside new components, and win over the old !important utilities there. Old pages don't change; this was checked pixel by pixel in kubedb-ui.
  • Don't put utility classes on new components while both are loaded. Wrap the component in your own element for spacing.

Either way

import { AcButton, AcInput, useToast } from "@ac-design/design-system";
import { AcCodeEditor, AcFileEditor } from "@ac-design/design-system/editor";
import { AcLineChart, AcDonutChart } from "@ac-design/design-system/charts";
  • Requirements: Vue 3.5+, Vite 5+ or Nuxt 3+, and TypeScript with moduleResolution: "bundler". Every component renders on the server, so Nuxt SSR works.
  • Peer dependencies: vue ^3.5 and @lucide/vue ^1.0, plus echarts ^6 (optional) for /charts. CodeMirror, Ajv and yaml are regular dependencies, bundled only by apps that import from /editor.
  • Dark mode: put .dark on <html> (the old .is-dark-theme class works too), or call useColorMode().setMode("dark" | "light" | "system"). The user's choice is saved under the old themeMode localStorage key.
  • Toasts: mount <AcToaster /> once near the root, then call useToast().success("Saved") anywhere.
  • Brand colour: useBrandColor().setColor("#0066cc") re-hues the primary scale. The old HexToHSL, setThemeHSL and getThemeHSL helpers are exported under the same names.
  • Router links: components with to props use vue-router's RouterLink when the app registers it. The library itself doesn't depend on vue-router.

Scripts

CommandWhat it does
npm run devRegenerates the API data, then starts the docs site at http://localhost:5173
npm run buildRegenerates the API data, type-checks, and builds the docs site into dist/
npm run previewServes the built docs site from dist/
npm run build:libBuilds the library into dist/lib: ES modules, .d.ts files, theme.css and compat.css
npm run type-checkvue-tsc over the whole project
npm run metaRegenerates src/docs/generated/component-meta.json (the API tables) from the components' types

There is no test runner, ESLint or Prettier config yet. Type-check and both builds must pass, and changes are checked in the browser in light, dark and phone widths.

Project layout

src/
  lib/                        the design system (what gets published)
    theme.css                 tokens as a Tailwind @theme, the dark theme, utilities and keyframes
    index.ts                  main entry: every component, composable and public type
    components/               AcButton.vue, AcInput.vue, … one file per component (sub-parts too)
      index.ts                component exports, sorted
      types.ts                shared types (Tone, Variant, Option, SelectOption)
    editor/                   the /editor entry: index.ts, CodeMirror theme, YAML/JSON Schema checks
    charts/                   the /charts entry: index.ts, ECharts setup, ChartFrame.vue (legend, tooltip, sr-only table)
    composables/              useColorMode, useFontScale, useToast, useBrandColor, pagination, selection and form helpers
  docs/                       the documentation site
    nav.ts                    every page: path, title, description, section, group, component
    router.ts                 hash router built from nav.ts
    pages/                    getting-started/, foundations/, components/, examples/
    examples/<slug>/*.vue     one runnable file per example, shown live with its source
    snippets/<page>/*.txt     code samples shown on pages, loaded with ?raw
    components/               doc building blocks: ComponentPlayground, ComponentExample, ApiTables, DoDont…
    layout/                   header, sidebar, table of contents, search
    generated/                component-meta.json, written by scripts/gen-meta.mjs (don't edit)
scripts/
  gen-meta.mjs                reads component types with vue-component-meta → API tables
  copy-theme.mjs              ships theme.css with the library build
  build-compat.mjs            builds compat.css for apps that still load the old styles
public/                       favicon, logos
vite.config.ts                docs site
vite.lib.config.ts            library build (three entries: index, editor/index and charts/index)

Contributing

Read CLAUDE.md first. It's the full guide to the codebase, written for people and coding agents alike: context, structure, component and docs patterns, the writing style, and what not to do.

The short version for a new component:

  1. Write src/lib/components/AcThing.vue with <script setup lang="ts">, a JSDoc line on every prop, and theme tokens only. Export it from src/lib/components/index.ts, and its public types from src/lib/index.ts.
  2. Add examples as files in src/docs/examples/thing/, importing from @/lib.
  3. Add src/docs/pages/components/ThingPage.vue and register it in src/docs/nav.ts.
  4. Run npm run dev. The API tables regenerate from your types.
  5. Add old → new rows to the Migration page if it replaces something from the old library.
  6. Check light, dark and a 375px phone width, then run npm run build and npm run build:lib.

Commit with git commit -s.

版本与发布记录

@ac-design/design-system 共发布 31 个版本,首次发布于 2026/10/08;过去 12 个月发布了 31 个版本。

版本发布日期距今
2.11.0latest2026/11/016 天前
2.10.32026/10/308 天前
2.10.22026/10/308 天前
2.10.12026/10/299 天前
2.10.02026/10/2612 天前
2.9.12026/10/2315 天前

关于 @ac-design/design-system 的常见问题

@ac-design/design-system 是什么?

AppsCode design system: Tailwind CSS v4 theme and Vue 3 components.

如何安装 @ac-design/design-system?

在项目目录运行 npm install @ac-design/design-system,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、@lucide/vue(^1.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ac-design/design-system 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ac-design/design-system 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ac-design/design-system 可以商用吗?

@ac-design/design-system 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@ac-design/design-system 的下载量有多少?

根据 npm 官方下载统计,@ac-design/design-system 在 2026/10/05 – 2026/11/03 这 30 天内被下载 5,029 次,日均约 168 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ac-design/design-system 还在维护吗?

最新版本 2.11.0 发布于 2026/11/01(6 天前);至今共发布 31 个版本,其中过去 12 个月发布了 31 个;首次发布于 2026/10/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。