@clidey/ux

中文文档
1.6.4发布于 2026/11/03Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 2183

Clidey Design — accessible React components and design tokens.

原始使用文档
文档目录28 节
  1. Why Clidey Design?
  2. Installation
  3. Quick start
  4. Components
  5. Actions
  6. Inputs
  7. Display
  8. Navigation
  9. Overlays
  10. Menus
  11. Layout
  12. Data & Visualization
  13. Utilities
  14. Theme
  15. Usage examples
  16. Catalog icons
  17. Triggers and asChild
  18. Confirmation dialog
  19. Toast notifications
  20. Command palette (⌘K)
  21. Large dataset table with virtualization
  22. Theming
  23. Next.js
  24. Peer dependencies
  25. Contributing
  26. Not found page
  27. License
  28. Clidey Design icons

Clidey Design

Clidey Design
A production-ready React component library built on Radix UI and Tailwind CSS v4.
37+ accessible, composable, dark-mode-ready components — drop in and ship.

npm version downloads Apache 2.0 license React 18/19 TypeScript


Why Clidey Design?

Building a consistent, accessible UI from scratch takes weeks. Clidey Design gives you a complete set of polished components so you can focus on your product, not your design system.

  • Accessible by default — every component is built on Radix UI primitives. Keyboard navigation, focus management, and ARIA attributes are handled for you.
  • Dark mode included — wrap your app with ThemeProvider and all components adapt automatically. System preference detection and localStorage persistence built in.
  • Fully typed — complete TypeScript definitions with strict mode. Autocomplete for every prop, variant, and event handler.
  • Composable API — sub-component patterns give you full control over layout and markup without fighting against an opinionated structure.
  • Tailwind CSS v4 — styled with utility classes you already know. Override anything with className.
  • Zero configuration — one import, one stylesheet, done.

Installation

npm install @clidey/ux
# or
pnpm add @clidey/ux
# or
yarn add @clidey/ux

Import the stylesheet once at your app entry point:

// main.tsx / _app.tsx
import '@clidey/ux/styles.css';

Wrap with ThemeProvider to enable dark mode:

import { ThemeProvider } from '@clidey/ux';

export default function App() {
  return (
    <ThemeProvider defaultTheme="system">
      {/* your app */}
    </ThemeProvider>
  );
}

That's it. No extra configuration, no Tailwind setup required in your project.


Quick start

import {
  Button,
  Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
  Badge,
  Input,
  Label,
} from '@clidey/ux';
import '@clidey/ux/styles.css';

export default function Example() {
  return (
    <Card className="max-w-sm">
      <CardHeader>
        <CardTitle>Create account</CardTitle>
        <CardDescription>Get started in seconds. No credit card required.</CardDescription>
      </CardHeader>
      <CardContent className="space-y-3">
        <div className="space-y-1">
          <Label htmlFor="email">Email</Label>
          <Input id="email" type="email" placeholder="[email protected]" />
        </div>
        <div className="space-y-1">
          <Label htmlFor="password">Password</Label>
          <Input id="password" type="password" showPasswordToggle />
        </div>
      </CardContent>
      <CardFooter className="flex items-center justify-between">
        <Badge variant="outline">Free plan</Badge>
        <Button>Create account</Button>
      </CardFooter>
    </Card>
  );
}

Components

Actions

ComponentDescription
Button6 variants (default, destructive, outline, secondary, ghost, link) · 4 sizes
ButtonGroupConnected button strip for toolbars and segmented controls

Inputs

ComponentDescription
InputText field with optional password toggle
TextAreaMulti-line text input
SearchInputText field with built-in search icon
CheckboxAccessible checkbox with indeterminate state
SwitchToggle for boolean settings
SelectComposable dropdown selector
SearchSelectDropdown with search filtering and icon support
LabelAccessible form label

Display

ComponentDescription
BadgeStatus and category labels · 4 variants
CardContainer with header, content, footer, and action slots
AlertInline feedback messages · default and destructive
SpinnerAnimated loader · 5 color variants · 3 sizes
SkeletonPulsing placeholder for loading states
ProgressLinear progress bar
EmptyStatePlaceholder for empty lists and zero-state screens
SeparatorHorizontal or vertical divider

Navigation

ComponentDescription
TabsTab panels for switching between sections
BreadcrumbHierarchical path with ellipsis support
PaginationPrevious / next and numbered page controls
SidebarFull sidebar with collapsible menus, submenus, mobile support

Overlays

ComponentDescription
DialogModal with focus trap and scroll lock
AlertDialogBlocking confirmation for destructive actions
DrawerSlide-in panel from any edge (powered by Vaul)
SheetSide panel overlay (powered by Radix Dialog)
TooltipHover label with configurable delay and position
PopoverClick-anchored floating panel

Menus

ComponentDescription
DropdownMenuTrigger menu with checkboxes, radio groups, and sub-menus
ContextMenuRight-click menu with the same rich item types
CommandFuzzy-search command palette (⌘K) powered by cmdk

Layout

ComponentDescription
AccordionCollapsible sections with animated expand/collapse
ResizablePanelGroupDrag-to-resize split views
MasterDetailPanelsList/detail split; one panel at a time below 768px
ScrollAreaCustom scrollbar with styled track and thumb
StackListKey-value metadata list with separators

Data & Visualization

ComponentDescription
TableFull table with virtualization for large datasets and JSON preview
ChartRecharts wrapper with theme-aware tooltips and legend
TreeHierarchical tree / file explorer with expand and selection

Utilities

ComponentDescription
IconSVG wrapper with consistent sizing
CatalogIconPlain SVG icon selected by catalog name
IconSearch, IconHome, …Named components for every catalog SVG, including Alt variants
ToasterToast notifications powered by Sonner

Theme

Component / HookDescription
ThemeProviderContext provider for light / dark / system theme
useThemeHook to read and set the active theme
ModeToggleReady-made dropdown to switch themes

Usage examples

Catalog icons

import { IconSearch, IconSearchAlt, CatalogIcon } from '@clidey/ux';

<IconSearch className="size-4" />
<IconSearchAlt size={20} />
<CatalogIcon name="source" size={16} />

Catalog icons inherit the current text color and accept SVG props and refs. Add aria-label when an icon needs its own accessible name.

Triggers and asChild

Wrap interactive children in DropdownMenuTrigger, TooltipTrigger, PopoverTrigger, DialogTrigger and friends without asChild; the trigger renders as the child when it is slot-safe (Button, Badge, SidebarMenuButton, intrinsic button/a/span/div, ...) and as its own button otherwise. Pass asChild only for non-ux elements that forward refs. See docs/triggers-and-aschild.md for the rule, the safe/unsafe table and the traps.

<DropdownMenuTrigger>
  <Button variant="ghost" size="icon"><MoreHorizontal /></Button>
</DropdownMenuTrigger>

Confirmation dialog

import {
  AlertDialog, AlertDialogTrigger, AlertDialogContent,
  AlertDialogHeader, AlertDialogTitle, AlertDialogDescription,
  AlertDialogFooter, AlertDialogCancel, AlertDialogAction,
  Button,
} from '@clidey/ux';

<AlertDialog>
  <AlertDialogTrigger>
    <Button variant="destructive">Delete account</Button>
  </AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
      <AlertDialogDescription>
        This action cannot be undone. Your data will be permanently deleted.
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Delete account</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

Toast notifications

import { Toaster, toast } from '@clidey/ux';

// In your root layout
<Toaster />

// Anywhere in your app
toast.success('Saved successfully!');
toast.error('Something went wrong.');
toast.promise(saveData(), {
  loading: 'Saving...',
  success: 'Done!',
  error: 'Failed to save.',
});

Command palette (⌘K)

import {
  CommandDialog, CommandInput, CommandList,
  CommandEmpty, CommandGroup, CommandItem,
} from '@clidey/ux';

<CommandDialog open={open} onOpenChange={setOpen}>
  <CommandInput placeholder="Search commands..." />
  <CommandList>
    <CommandEmpty>No results found.</CommandEmpty>
    <CommandGroup heading="Navigation">
      <CommandItem onSelect={() => navigate('/dashboard')}>Dashboard</CommandItem>
      <CommandItem onSelect={() => navigate('/settings')}>Settings</CommandItem>
    </CommandGroup>
  </CommandList>
</CommandDialog>

Large dataset table with virtualization

import {
  TableProvider, Table, TableHeader, TableHeadRow,
  TableHead, VirtualizedTableBody, TableRow, TableCell,
} from '@clidey/ux';

<TableProvider columnCount={3}>
  <Table>
    <TableHeader>
      <TableHeadRow>
        <TableHead>ID</TableHead>
        <TableHead>Name</TableHead>
        <TableHead>Status</TableHead>
      </TableHeadRow>
    </TableHeader>
    <VirtualizedTableBody rowCount={10000} rowHeight={48} height={400}>
      {({ index, style }) => (
        <TableRow style={style}>
          <TableCell>{rows[index].id}</TableCell>
          <TableCell>{rows[index].name}</TableCell>
          <TableCell>{rows[index].status}</TableCell>
        </TableRow>
      )}
    </VirtualizedTableBody>
  </Table>
</TableProvider>

Theming

All visual tokens are exposed as CSS custom properties. Override them in your own stylesheet after importing @clidey/ux/styles.css:

:root {
  --primary: 250 84% 54%;          /* your brand color */
  --radius: 0.375rem;              /* border radius */
}

Dark mode is automatic — ThemeProvider applies a dark class to <html> and all components respond to it via Tailwind's dark: modifier.


Next.js

// app/providers.tsx
'use client';
import { ThemeProvider } from '@clidey/ux';

export function Providers({ children }: { children: React.ReactNode }) {
  return <ThemeProvider defaultTheme="system">{children}</ThemeProvider>;
}

// app/layout.tsx
import '@clidey/ux/styles.css';
import { Providers } from './providers';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

Peer dependencies

PackageVersion
react>= 18.3.0
react-dom>= 18.3.0

All other dependencies (Radix UI, Lucide, Recharts, Sonner, Vaul, cmdk) are bundled — no extra installs needed.


Contributing

Contributions, bug reports, and feature requests are welcome. Please open an issue or pull request on GitHub.

Not found page

Use the animated 404 view in your application's fallback route:

import { NotFoundPage } from '@clidey/ux';

<NotFoundPage homeHref="/" homeLabel="Back to home" />

Customize the copy with title, description, and eyebrow. Use onHome for router navigation or action for a custom action. Playback supports loop, once, and off through defaultMotion or controlled motion / onMotionChange props. Reduced motion preferences automatically show a still pose. Optional playback controls are enabled with showMotionControls.

License

Licensed under the Apache License 2.0.

Clidey Design icons

The full Clidey Design icon collection is available as raw SVG assets without loading it through the main UI entry. Import a single icon URL in a Vite app:

import searchUrl from "@clidey/ux/icons/svg/search.svg?url";

<img src={searchUrl} alt="" />

For a dynamic icon picker, import the icons URL map from @clidey/ux/icons. See icons/README.md for usage examples.

版本与发布记录

@clidey/ux 共发布 77 个版本,首次发布于 2025/07/28;过去 12 个月发布了 39 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.6.4latest2026/11/036 天前
1.6.32026/11/037 天前
1.6.22026/11/037 天前
1.6.12026/11/037 天前
1.6.02026/11/037 天前
1.5.32026/10/2318 天前

关于 @clidey/ux 的常见问题

@clidey/ux 是什么?

Clidey Design — accessible React components and design tokens.

如何安装 @clidey/ux?

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

@clidey/ux 支持 TypeScript 吗?

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

@clidey/ux 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@clidey/ux 可以商用吗?

@clidey/ux 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@clidey/ux 的下载量有多少?

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

@clidey/ux 还在维护吗?

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