跳到正文
Skillpedia
界面(UI/UX)48k · #5563

radix-ui-design-system

它能做什么

这个工具可以帮你搭建网站和应用的设计系统。它能让你创建按钮、菜单等界面组件,这些组件既易于访问,又可以完全自定义,而且不会强加一套现成的视觉风格。

适用场景

  • ✓从零开始搭建设计系统。
  • ✓构建易于访问的 UI 组件库。
  • ✓实现复杂的交互组件。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/radix-ui-design-system/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/radix-ui-design-system/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“使用 Radix UI 为一个待办事项应用创建一套易于访问的设计系统。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会利用 Radix UI 的基础构建模块来创建组件。你可以定义每个组件的外观和行为,确保大家都能轻松使用,并且能与其他开发工具良好配合。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Radix UI Design System

Build production-ready, accessible design systems using Radix UI primitives with full customization control and zero style opinions.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • Creating a custom design system from scratch
  • Building accessible UI component libraries
  • Implementing complex interactive components (Dialog, Dropdown, Tabs, etc.)
  • Migrating from styled component libraries to unstyled primitives
  • Setting up theming systems with CSS variables or Tailwind
  • Need full control over component behavior and styling
  • Building applications requiring WCAG 2.1 AA/AAA compliance

Do not use this skill when

  • You need pre-styled components out of the box (use shadcn/ui, Mantine, etc.)
  • Building simple static pages without interactivity
  • The project doesn't use React 16.8+ (Radix requires hooks)
  • You need components for frameworks other than React

Real-World Examples

Example 1: Command Palette (Combo Dialog)

import * as Dialog from '@radix-ui/react-dialog';
import { Command } from 'cmdk';

export function CommandPalette() {
  const [open, setOpen] = useState(false);

  useEffect(() => {
    const down = (e: KeyboardEvent) => {
      if (e.key === 'k' && (e.metaKey || e.ctrlKey)) {
        e.preventDefault();
        setOpen((open) => !open);
      }
    };
    document.addEventListener('keydown', down);
    return () => document.removeEventListener('keydown', down);
  }, []);

  return (
    <Dialog.Root open={open} onOpenChange={setOpen}>
      <Dialog.Portal>
        <Dialog.Overlay className="fixed inset-0 bg-black/50" />
        <Dialog.Content className="fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2">
          <Command>
            <Command.Input placeholder="Type a command..." />
            <Command.List>
              <Command.Empty>No results found.</Command.Empty>
              <Command.Group heading="Suggestions">
                <Command.Item>Calendar</Command.Item>
                <Command.Item>Search Emoji</Command.Item>
              </Command.Group>
            </Command.List>
          </Command>
        </Dialog.Content>
      </Dialog.Portal>
    </Dialog.Root>
  );
}

Example 2: Dropdown Menu with Icons

import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import { DotsHorizontalIcon } from '@radix-ui/react-icons';

export function ActionsMenu() {
  return (
    <DropdownMenu.Root>
      <DropdownMenu.Trigger asChild>
        <button className="icon-button" aria-label="Actions">
          <DotsHorizontalIcon />
        </button>
      </DropdownMenu.Trigger>

      <DropdownMenu.Portal>
        <DropdownMenu.Content className="dropdown-content" align="end">
          <DropdownMenu.Item className="dropdown-item">
            Edit
          </DropdownMenu.Item>
          <DropdownMenu.Item className="dropdown-item">
            Duplicate
          </DropdownMenu.Item>
          <DropdownMenu.Separator className="dropdown-separator" />
          <DropdownMenu.Item className="dropdown-item text-red-500">
            Delete
          </DropdownMenu.Item>
        </DropdownMenu.Content>
      </DropdownMenu.Portal>
    </DropdownMenu.Root>
  );
}

Example 3: Form with Radix Select + React Hook Form

import * as Select from '@radix-ui/react-select';
import { useForm, Controller } from 'react-hook-form';

interface FormData {
  country: string;
}

export function CountryForm() {
  const { control, handleSubmit } = useForm<FormData>();

  return (
    <form onSubmit={handleSubmit((data) => console.log(data))}>
      <Controller
        name="country"
        control={control}
        render={({ field }) => (
          <Select.Root onValueChange={field.onChange} value={field.value}>
            <Select.Trigger className="select-trigger">
              <Select.Value placeholder="Select a country" />
              <Select.Icon />
            </Select.Trigger>
            
            <Select.Portal>
              <Select.Content className="select-content">
                <Select.Viewport>
                  <Select.Item value="us">United States</Select.Item>

…
常见问题

什么是“无样式基础组件”(headless primitives)?

这些是 UI 组件的基础构建模块,本身不带预设的视觉样式。这让你可以完全自由地按照自己的想法来设计样式。

“易于访问”是什么意思?

指这些组件的设计目标是让所有人都能使用,包括有视力、运动或其他障碍的人。它们遵循 WCAG 等无障碍指南。

使用这个工具需要了解 React 吗?

需要。这个工具面向使用 React 的项目,因为 Radix UI 是一个 React 组件库。

详情

作者的原始描述

Build accessible design systems with Radix UI primitives. Headless component customization, theming strategies, and compound component patterns for production-grade UI libraries.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5563
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能