@carsxe/design-system

中文文档
0.3.8发布于 2026/10/15MITTypeScriptES Module构建来源已验证近 30 天下载 1.2万

Carsxe design system ??? shadcn/ui components themed to the Carsxe brand.

原始使用文档
文档目录8 节
  1. Install
  2. Load CSS
  3. Usage
  4. Components
  5. Tour
  6. Theming
  7. Guidelines
  8. License

@carsxe/design-system

Carsxe design system — shadcn/ui components themed to the Carsxe brand. Ship consistent UI by installing this package; do not run shadcn add in your app.

Install

npm install @carsxe/design-system
pnpm add @carsxe/design-system
bun add @carsxe/design-system

Peer dependencies: react and react-dom (v19).

Load CSS

Import the theme once, near your app entry.

If your app already compiles Tailwind v4:

import "@carsxe/design-system/globals.css"

// This stylesheet does not bundle the fonts — import them so your bundler
// resolves and fingerprints the woff2 files itself.
import "@fontsource-variable/manrope"
import "@fontsource-variable/dm-sans"
import "@fontsource/dm-mono/300.css"
import "@fontsource/dm-mono/400.css"
import "@fontsource/dm-mono/500.css"

Otherwise import the prebuilt stylesheet, which is self-contained (fonts included):

import "@carsxe/design-system/styles.css"

Fonts are Manrope (UI, body, inputs), DM Sans (headings), and DM Mono (code). If you load them another way — next/font, for example — point --font-sans, --font-body, --font-heading, and --font-mono at your own families instead of importing the packages above.

Usage

Prefer the per-component import path:

import { Button } from "@carsxe/design-system/components/button"

export function Example() {
  return <Button>Get started</Button>
}

The package root also works:

import { Button, Card, Input } from "@carsxe/design-system"

Components

Accordion, Alert, Angle Slider, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Clipboard, Color Picker, Date Input, Dialog, Dropdown menu, Editable, Floating Panel, Format, Highlight, Image Cropper, Input, JSON Tree View, Label, Listbox, Marquee, Mega menu, Navigation menu, Number Input, Pagination, Password Input, Progress, QR Code, Radio group, Rating Group, Select, Separator, Signature Pad, Skeleton, Slider, Sonner, Steps, Swap, Switch, Table, Table of Contents, Tabs, Tags Input, Textarea, Timer, Tour, Tree View, Tooltip.

Each is available from @carsxe/design-system/components/<name>. Alert and Badge add success and warning variants on top of the usual shadcn set. Input has no size variant — use className (e.g. h-8) for compact heights.

The advanced components are Carsxe-owned implementations and do not depend on Ark UI or Zag. Interactive transitions use Motion and respect reduced-motion preferences. Components support controlled and uncontrolled state through value/defaultValue and onValueChange, or open/defaultOpen and onOpenChange where applicable.

Tour

const tour = useTour({
  steps: [
    { id: "welcome", type: "dialog", title: "Welcome" },
    { id: "search", target: "#search", title: "Search by VIN" },
  ],
})

return (
  <>
    <button onClick={(event) => tour.start(undefined, event.currentTarget)}>
      Start tour
    </button>
    <Tour tour={tour} />
  </>
)

Theming

Semantic tokens live on :root and .dark. Customize with CSS variables rather than forking components.

TokenLight
--primary#065774
--primary-hover#387990
--foreground#3A3A3A
--background#F9F9F9
--success#00A63E
--destructive#DA373E
--warning#F79008
--radius0

--radius is 0, so corners are sharp; circular controls keep rounded-full. Enable dark mode by adding the dark class on an ancestor, usually <html>:

<html class="dark">

Guidelines

  • Do not run shadcn add in the consumer app — components ship from this package.
  • Do not copy component source into your app or wrap the primitives.
  • Customize with variant, size, className, and native element props.

License

MIT

版本与发布记录

@carsxe/design-system 共发布 22 个版本,首次发布于 2026/08/19;过去 12 个月发布了 22 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.8latest2026/10/1524 天前
0.3.72026/10/1524 天前
0.3.62026/09/241 个月前
0.3.52026/09/171 个月前
0.3.42026/09/161 个月前
0.3.32026/09/161 个月前

其他发布通道:next → 0.3.0-rc.4。

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

@carsxe/design-system 是什么?

Carsxe design system ??? shadcn/ui components themed to the Carsxe brand.

如何安装 @carsxe/design-system?

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

@carsxe/design-system 支持 TypeScript 吗?

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

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

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

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

@carsxe/design-system 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

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