---
name: radix-ui-design-system
description: "Radix UI Design System workflow skill. Use this skill when the user needs Build accessible design systems with Radix UI primitives. Headless component customization, theming strategies, and compound component patterns for production-grade UI libraries and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off."
version: "0.0.1"
category: frontend
tags: ["radix-ui-design-system", "build", "accessible", "design", "systems", "radix", "primitives", "headless"]
complexity: advanced
risk: caution
tools: ["codex-cli", "claude-code", "cursor", "gemini-cli", "opencode"]
source: community
author: "sickn33"
date_added: "2026-04-15"
date_updated: "2026-04-25"
---
# Radix UI Design System
## Overview
This public intake copy packages `plugins/antigravity-awesome-skills-claude/skills/radix-ui-design-system` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses the `external_source` block in `metadata.json` plus `ORIGIN.md` as the provenance anchor for review.
# Radix UI Design System Build production-ready, accessible design systems using Radix UI primitives with full customization control and zero style opinions.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Getting Started, Theming Strategies, Component Patterns, Accessibility Checklist, Performance Optimization, Integration with Popular Tools.
## When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- 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
## Operating Table
| Situation | Start here | Why it matters |
| --- | --- | --- |
| First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow |
| Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution | `examples/README.md` | Starts with the smallest copied file that materially changes execution |
| Supporting context | `examples/dialog-example.tsx` | Adds the next most relevant copied source file without loading the entire package |
| Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts |
## Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
1. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
2. Read the overview and provenance files before loading any copied upstream support files.
3. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
4. Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes.
5. Validate the result against the upstream expectations and the evidence you can point to in the copied files.
6. Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity.
7. Before merge or closure, record what was used, what changed, and what the reviewer still needs to verify.
### Imported Workflow Notes
#### Imported: Overview
Radix UI provides unstyled, accessible components (primitives) that you can customize to match any design system. This skill guides you through building scalable component libraries with Radix UI, focusing on accessibility-first design, theming architecture, and composable patterns.
**Key Strengths:**
- **Headless by design**: Full styling control without fighting defaults
- **Accessibility built-in**: WAI-ARIA compliant, keyboard navigation, screen reader support
- **Composable primitives**: Build complex components from simple building blocks
- **Framework agnostic**: Works with React, but styles work anywhere
#### Imported: Getting Started
### Installation
```bash
# Install individual primitives (recommended)
npm install @radix-ui/react-dialog @radix-ui/react-dropdown-menu
# Or install multiple at once
npm install @radix-ui/react-{dialog,dropdown-menu,tabs,tooltip}
# For styling (optional but common)
npm install clsx tailwind-merge class-variance-authority
```
### Basic Component Pattern
Every Radix component follows this pattern:
```tsx
import * as Dialog from '@radix-ui/react-dialog';
export function MyDialog() {
return (
{/* Trigger the dialog */}
{/* Portal renders outside DOM hierarchy */}
{/* Overlay (backdrop) */}
{/* Content (modal) */}
TitleDescription
{/* Your content here */}
);
}
```
---
## Examples
### Example 1: Ask for the upstream workflow directly
```text
Use @radix-ui-design-system to handle . Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
```
**Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
### Example 2: Ask for a provenance-grounded review
```text
Review @radix-ui-design-system against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
```
**Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
### Example 3: Narrow the copied support files before execution
```text
Use @radix-ui-design-system for . Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
```
**Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
### Example 4: Build a reviewer packet
```text
Review @radix-ui-design-system using the copied upstream files plus provenance, then summarize any gaps before merge.
```
**Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet.
### Imported Usage Notes
#### Imported: Real-World Examples
### Example 1: Command Palette (Combo Dialog)
```tsx
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 (
No results found.CalendarSearch Emoji
);
}
```
### Example 2: Dropdown Menu with Icons
```tsx
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import { DotsHorizontalIcon } from '@radix-ui/react-icons';
export function ActionsMenu() {
return (
Edit
Duplicate
Delete
);
}
```
### Example 3: Form with Radix Select + React Hook Form
```tsx
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();
return (
);
}
```
---
## Best Practices
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
- Keyboard Navigation: Full keyboard support (Tab, Arrow keys, Enter, Escape)
- Screen Readers: Proper ARIA attributes and live regions
- Focus Management: Automatic focus trapping and restoration
- Disabled States: Proper handling of disabled and aria-disabled
- Always use asChild to avoid wrapper divs
- Provide semantic HTML
- Use CSS variables for theming
### Imported Operating Notes
#### Imported: Core Principles
### 1. Accessibility First
Every Radix primitive is built with accessibility as the foundation:
- **Keyboard Navigation**: Full keyboard support (Tab, Arrow keys, Enter, Escape)
- **Screen Readers**: Proper ARIA attributes and live regions
- **Focus Management**: Automatic focus trapping and restoration
- **Disabled States**: Proper handling of disabled and aria-disabled
**Rule**: Never override accessibility features. Enhance, don't replace.
### 2. Headless Architecture
Radix provides **behavior**, you provide **appearance**:
```tsx
// ❌ Don't fight pre-styled components
// ✅ Radix gives you behavior, you add styling
```
### 3. Composition Over Configuration
Build complex components from simple primitives:
```tsx
// Primitive components compose naturally
Tab 1Tab 2Content 1Content 2
```
---
#### Imported: Best Practices
### ✅ Do This
1. **Always use `asChild` to avoid wrapper divs**
```tsx
```
2. **Provide semantic HTML**
```tsx
{/* content */}
```
3. **Use CSS variables for theming**
```css
.dialog-content {
background: hsl(var(--surface));
color: hsl(var(--on-surface));
}
```
4. **Compose primitives for complex components**
```tsx
function CommandPalette() {
return (
{/* Radix Combobox inside Dialog */}
);
}
```
### ❌ Don't Do This
1. **Don't skip accessibility parts**
```tsx
// ❌ Missing Title and Description
Content
```
2. **Don't fight the primitives**
```tsx
// ❌ Overriding internal behavior
e.stopPropagation()}>
```
3. **Don't mix controlled and uncontrolled**
```tsx
// ❌ Inconsistent state management
```
4. **Don't ignore keyboard navigation**
```tsx
// ❌ Disabling keyboard behavior
e.preventDefault()}>
```
---
## Troubleshooting
### Problem: The operator skipped the imported context and answered too generically
**Symptoms:** The result ignores the upstream workflow in `plugins/antigravity-awesome-skills-claude/skills/radix-ui-design-system`, fails to mention provenance, or does not use any copied source files at all.
**Solution:** Re-open `metadata.json`, `ORIGIN.md`, and the most relevant copied upstream files. Check the `external_source` block first, then restate the provenance before continuing.
### Problem: The imported workflow feels incomplete during review
**Symptoms:** Reviewers can see the generated `SKILL.md`, but they cannot quickly tell which references, examples, or scripts matter for the current task.
**Solution:** Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
### Problem: The task drifted into a different specialization
**Symptoms:** The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better.
**Solution:** Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
### Imported Troubleshooting Notes
#### Imported: Troubleshooting
### Problem: Dialog doesn't close on Escape key
**Cause**: `onEscapeKeyDown` event prevented or `open` state not synced
**Solution**:
```tsx
{/* Don't prevent default on escape */}
```
### Problem: Dropdown menu positioning is off
**Cause**: Parent container has `overflow: hidden` or transform
**Solution**:
```tsx
// Use Portal to render outside overflow container
```
### Problem: Animations don't work
**Cause**: Portal content unmounts immediately
**Solution**:
```tsx
// Use forceMount + AnimatePresence
{open && }
```
### Problem: TypeScript errors with `asChild`
**Cause**: Type inference issues with polymorphic components
**Solution**:
```tsx
// Explicitly type your component
```
---
## Related Skills
- `@00-andruia-consultant` - Use when the work is better handled by that native specialization after this imported skill establishes context.
- `@00-andruia-consultant-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.
- `@10-andruia-skill-smith` - Use when the work is better handled by that native specialization after this imported skill establishes context.
- `@10-andruia-skill-smith-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.
## Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
| Resource family | What it gives the reviewer | Example path |
| --- | --- | --- |
| `references` | copied reference notes, guides, or background material from upstream | `references/n/a` |
| `examples` | worked examples or reusable prompts copied from upstream | `examples/README.md` |
| `scripts` | upstream helper scripts that change execution or validation | `scripts/n/a` |
| `agents` | routing or delegation notes that are genuinely part of the imported package | `agents/n/a` |
| `assets` | supporting assets or schemas copied from the source package | `assets/n/a` |
- [README.md](examples/README.md)
- [dialog-example.tsx](examples/dialog-example.tsx)
- [dropdown-example.tsx](examples/dropdown-example.tsx)
- [README.md](examples/README.md)
- [dialog-example.tsx](examples/dialog-example.tsx)
- [dropdown-example.tsx](examples/dropdown-example.tsx)
### Imported Reference Notes
#### Imported: Common Primitives Reference
### Dialog (Modal)
```tsx
{/* State container */}
{/* Opens dialog */}
{/* Renders in portal */}
{/* Backdrop */}
{/* Modal content */}
{/* Required for a11y */}
{/* Required for a11y */}
{/* Closes dialog */}
```
### Dropdown Menu
```tsx
{/* Nested menus */}
```
### Tabs
```tsx
```
### Tooltip
```tsx
Tooltip text
```
### Popover
```tsx
Content
```
---
#### Imported: Resources
### Official Documentation
- [Radix UI Docs](https://www.radix-ui.com/primitives)
- [Radix Colors](https://www.radix-ui.com/colors) - Accessible color system
- [Radix Icons](https://www.radix-ui.com/icons) - Icon library
### Community Resources
- [shadcn/ui](https://ui.shadcn.com) - Component collection
- [Radix UI Discord](https://discord.com/invite/7Xb99uG) - Community support
- [CVA Documentation](https://cva.style/docs) - Variant management
### Examples
- [Radix Playground](https://www.radix-ui.com/primitives/docs/overview/introduction#try-it-out)
- [shadcn/ui Source](https://github.com/shadcn-ui/ui) - Production examples
---
#### Imported: Quick Reference
### Installation
```bash
npm install @radix-ui/react-{primitive-name}
```
### Basic Pattern
```tsx
```
### Key Props
- `asChild` - Render as child element
- `defaultValue` - Uncontrolled default
- `value` / `onValueChange` - Controlled state
- `open` / `onOpenChange` - Open state
- `side` / `align` - Positioning
---
**Remember**: Radix gives you **behavior**, you give it **beauty**. Accessibility is built-in, customization is unlimited.
#### Imported: Theming Strategies
### Strategy 1: CSS Variables (Framework-Agnostic)
**Best for**: Maximum portability, SSR-friendly
```css
/* globals.css */
:root {
--color-primary: 220 90% 56%;
--color-surface: 0 0% 100%;
--radius-base: 0.5rem;
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
[data-theme="dark"] {
--color-primary: 220 90% 66%;
--color-surface: 222 47% 11%;
}
```
```tsx
// Component.tsx
```
### Strategy 2: Tailwind + CVA (Class Variance Authority)
**Best for**: Tailwind projects, variant-heavy components
```tsx
// button.tsx
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const buttonVariants = cva(
// Base styles
"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline: "border border-input bg-background hover:bg-accent",
ghost: "hover:bg-accent hover:text-accent-foreground",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);
interface ButtonProps extends VariantProps {
children: React.ReactNode;
}
export function Button({ variant, size, children }: ButtonProps) {
return (
);
}
```
### Strategy 3: Stitches (CSS-in-JS)
**Best for**: Runtime theming, scoped styles
```tsx
import { styled } from '@stitches/react';
import * as Dialog from '@radix-ui/react-dialog';
const StyledContent = styled(Dialog.Content, {
backgroundColor: '$surface',
borderRadius: '$md',
padding: '$6',
variants: {
size: {
small: { width: '300px' },
medium: { width: '500px' },
large: { width: '700px' },
},
},
defaultVariants: {
size: 'medium',
},
});
```
---
#### Imported: Component Patterns
### Pattern 1: Compound Components with Context
**Use case**: Share state between primitive parts
```tsx
// Select.tsx
import * as Select from '@radix-ui/react-select';
import { CheckIcon, ChevronDownIcon } from '@radix-ui/react-icons';
export function CustomSelect({ items, placeholder, onValueChange }) {
return (
{items.map((item) => (
{item.label}
))}
);
}
```
### Pattern 2: Polymorphic Components with `asChild`
**Use case**: Render as different elements without losing behavior
```tsx
// ✅ Render as Next.js Link but keep Radix behavior
Open Settings
// ✅ Render as custom component
}>Action
```
**Why `asChild` matters**: Prevents nested button/link issues in accessibility tree.
### Pattern 3: Controlled vs Uncontrolled
```tsx
// Uncontrolled (Radix manages state)
Tab 1
// Controlled (You manage state)
const [activeTab, setActiveTab] = useState('tab1');
Tab 1
```
**Rule**: Use controlled when you need to sync with external state (URL, Redux, etc.).
### Pattern 4: Animation with Framer Motion
```tsx
import * as Dialog from '@radix-ui/react-dialog';
import { motion, AnimatePresence } from 'framer-motion';
export function AnimatedDialog({ open, onOpenChange }) {
return (
{open && (
<>
{/* Content */}
>
)}
);
}
```
---
#### Imported: Accessibility Checklist
### Every Component Must Have:
- [ ] **Focus Management**: Visible focus indicators on all interactive elements
- [ ] **Keyboard Navigation**: Full keyboard support (Tab, Arrows, Enter, Esc)
- [ ] **ARIA Labels**: Meaningful labels for screen readers
- [ ] **Color Contrast**: WCAG AA minimum (4.5:1 for text, 3:1 for UI)
- [ ] **Error States**: Clear error messages with `aria-invalid` and `aria-describedby`
- [ ] **Loading States**: Proper `aria-busy` during async operations
### Dialog-Specific:
- [ ] `Dialog.Title` is present (required for screen readers)
- [ ] `Dialog.Description` provides context
- [ ] Focus trapped inside modal when open
- [ ] Escape key closes dialog
- [ ] Focus returns to trigger on close
### Dropdown-Specific:
- [ ] Arrow keys navigate items
- [ ] Type-ahead search works
- [ ] First/last item wrapping behavior
- [ ] Selected state indicated visually and with ARIA
---
#### Imported: Performance Optimization
### 1. Code Splitting
```tsx
// Lazy load heavy primitives
const Dialog = lazy(() => import('@radix-ui/react-dialog'));
const DropdownMenu = lazy(() => import('@radix-ui/react-dropdown-menu'));
```
### 2. Portal Container Reuse
```tsx
// Create portal container once
{/* All tooltips share portal container */}
......
```
### 3. Memoization
```tsx
// Memoize expensive render functions
const SelectItems = memo(({ items }) => (
items.map((item) => )
));
```
---
#### Imported: Integration with Popular Tools
### shadcn/ui (Built on Radix)
shadcn/ui is a collection of copy-paste components built with Radix + Tailwind.
```bash
npx shadcn-ui@latest init
npx shadcn-ui@latest add dialog
```
**When to use shadcn vs raw Radix**:
- Use shadcn: Quick prototyping, standard designs
- Use raw Radix: Full customization, unique designs
### Radix Themes (Official Styled System)
```tsx
import { Theme, Button, Dialog } from '@radix-ui/themes';
function App() {
return (
);
}
```
---
#### Imported: Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.