Radix UI primitives for accessible React components. Covers dialogs, dropdowns, popovers, and form controls. Triggers on radix, Dialog, Popover, DropdownMenu.
Build accessible React components using Radix UI primitives. Triggers when you mention radix, Dialog, Popover, or DropdownMenu to create unstyled, accessible UI components.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
<mcp_first> CRITICAL: Fetch Radix UI documentation before implementing.
MCPSearch({ query: "select:mcp__plugin_devtools_context7__query-docs" })
// Radix primitives
mcp__context7__query_docs({
libraryId: "/radix-ui/primitives",
query: "How do I use Dialog with Trigger and Content?",
});
// Form controls
mcp__context7__query_docs({
libraryId: "/radix-ui/primitives",
query: "How do I use Select, Checkbox, and RadioGroup?",
});
// Accessibility
mcp__context7__query_docs({
libraryId: "/radix-ui/primitives",
query: "How do I handle accessibility, aria, and keyboard navigation?",
});
Note: Context7 v2 uses server-side filtering. Use descriptive natural language queries. </mcp_first>
<quick_start> Dialog:
import * as Dialog from "@radix-ui/react-dialog";
function MyDialog() {
return (
<Dialog.Root>
<Dialog.Trigger asChild>
<button>Open Dialog</button>
</Dialog.Trigger>
<Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 bg-black/50" />
<Dialog.Content className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg">
<Dialog.Title>Dialog Title</Dialog.Title>
<Dialog.Description>Dialog description.</Dialog.Description>
<Dialog.Close asChild>
<button>Close</button>
</Dialog.Close>
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
);
}
Dropdown Menu:
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
function MyDropdown() {
return (
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<button>Options</button>
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content className="bg-white rounded-md shadow-lg p-1">
<DropdownMenu.Item className="px-2 py-1 cursor-pointer hover:bg-gray-100">
Edit
</DropdownMenu.Item>
<DropdownMenu.Item className="px-2 py-1 cursor-pointer hover:bg-gray-100">
Delete
</DropdownMenu.Item>
<DropdownMenu.Separator className="h-px bg-gray-200 my-1" />
<DropdownMenu.Item className="px-2 py-1 cursor-pointer hover:bg-gray-100">
Settings
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Portal>
</DropdownMenu.Root>
);
}
Select:
import * as Select from "@radix-ui/react-select";
function MySelect() {
return (
<Select.Root>
<Select.Trigger className="border px-3 py-2 rounded">
<Select.Value placeholder="Select option" />
<Select.Icon />
</Select.Trigger>
<Select.Portal>
<Select.Content className="bg-white border rounded shadow-lg">
<Select.Viewport>
<Select.Item value="1" className="px-3 py-2 hover:bg-gray-100">
<Select.ItemText>Option 1</Select.ItemText>
</Select.Item>
<Select.Item value="2" className="px-3 py-2 hover:bg-gray-100">
<Select.ItemText>Option 2</Select.ItemText>
</Select.Item>
</Select.Viewport>
</Select.Content>
</Select.Portal>
</Select.Root>
);
}
</quick_start>
<common_components>
| Component | Use Case |
|---|---|
Dialog | Modals, confirmations |
AlertDialog | Destructive action confirmations |
DropdownMenu | Context menus, action menus |
Select | Form select inputs |
Popover | Floating content, tooltips |
Tooltip | Hover hints |
Tabs | Tabbed interfaces |
Accordion | Collapsible sections |
Checkbox | Boolean inputs |
RadioGroup | Single selection |
Switch | Toggle inputs |
Slider | Range inputs |
| </common_components> |
const [open, setOpen] = useState(false);
<Dialog.Root open={open} onOpenChange={setOpen}>
{/* ... */}
</Dialog.Root>;
asChild pattern:
// Radix renders YOUR button, not its own
<Dialog.Trigger asChild>
<Button variant="primary">Open</Button>
</Dialog.Trigger>
Portal for proper stacking:
<Dialog.Portal>
<Dialog.Overlay />
<Dialog.Content>{/* Content renders outside parent DOM */}</Dialog.Content>
</Dialog.Portal>
Forwarding refs:
const MyTrigger = forwardRef((props, ref) => (
<button ref={ref} {...props}>
Custom Trigger
</button>
));
<Dialog.Trigger asChild>
<MyTrigger />
</Dialog.Trigger>;
</patterns>
<constraints>
**Required:**
- Use `asChild` to compose with your own components
- Use `Portal` for overlays/dropdowns
- Provide accessible labels (Title, Description)
- Handle keyboard navigation (built-in)
Accessibility:
Title for dialogsDescription for additional context<success_criteria>
asChild for custom triggersThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.