Radix ui

From InugamiDev/ultrathink-oss · View interactive version

Radix ui is an AI agent skill from the GitHub repository InugamiDev/ultrathink-oss. - **Triggers**: radix, primitives, accessible components, headless ui, unstyled components

How to use this skill

Skill file

Radix UI

Overview

Unstyled, accessible UI primitives for building high-quality design systems. Radix provides the behavior, accessibility, and keyboard interactions — you provide the styling.

When to Use

Key Patterns

Composition Pattern

Every component follows Root > Trigger > Content composition. Use Portal for overlays to escape DOM stacking contexts.

<Dialog.Root>
  <Dialog.Trigger asChild><button>Open</button></Dialog.Trigger>
  <Dialog.Portal>
    <Dialog.Overlay />
    <Dialog.Content>
      <Dialog.Title>Title</Dialog.Title>
      <Dialog.Description>Description</Dialog.Description>
      <Dialog.Close asChild><button>Close</button></Dialog.Close>
    </Dialog.Content>
  </Dialog.Portal>
</Dialog.Root>

Controlled vs Uncontrolled

All components work uncontrolled by default. Use open/onOpenChange for controlled state.

Animation with data-state

Style enter/exit animations using data-[state=open] and data-[state=closed] attributes instead of managing animation state manually.

[data-state="open"] { animation: fadeIn 200ms ease-out; }
[data-state="closed"] { animation: fadeOut 150ms ease-in; }

Accessibility Built-in

ARIA roles, keyboard navigation, and focus management are handled automatically. Do not override role, aria-*, or tabIndex unless you have a specific reason.

Styling Integration

Use asChild to merge Radix behavior onto your own styled element. Use className or style directly on Radix components when not using asChild.

Context Value Forwarding

Nested Radix components share context automatically. Access internal state via render props or data-* attributes for conditional styling.

Anti-Patterns

Related Skills

react | shadcn-ui | design-systems | tailwindcss

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.