add-dialog-component

Create Radix UI dialog components with forms and tRPC mutations.

Updated Dec 5, 2025
One-click install
npx skills add https://github.com/betterbrand/dealflow-network --skill add-dialog-component
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-dialog-component
Source: https://github.com/betterbrand/dealflow-network/tree/main/.claude/skills/add-dialog-component
Command: npx skills add https://github.com/betterbrand/dealflow-network --skill add-dialog-component

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Speeds up UI development by generating ready-to-use Radix Dialogs with forms, state, and tRPC mutations.

Core Features & Use Cases

  • Dialog UI: Create Create/Edit/Delete dialogs using Radix primitives
  • Form State & Validation: Use useState and basic validation
  • Client Mutations: Integrate with trpc mutations and show toasts

Quick Start

Implement a CreateItemDialog or EditItemDialog in client/src/components and wire with trpc hooks.

Frequently Asked Questions about add-dialog-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a dialog component with forms in React using Radix UI?

Dialog components with forms in React use Radix UI primitives for the modal structure, useState hooks to manage form state, and tRPC mutations to handle server interactions. Radix provides accessible dialog triggers and content wrappers; combine these with controlled form inputs, validation logic, and mutation handlers to create create/edit dialogs with loading and error states.

Can I integrate tRPC mutations into Radix UI dialogs?

Yes, tRPC mutations integrate directly into Radix dialogs by wiring the mutation hook into form submission handlers. Call the mutation on form submit, track loading and error states from the mutation result, and conditionally render success or error feedback—typically via toasts—within the dialog to provide real-time feedback.

What's the best way to handle form validation and state in dialog components?

Use useState to manage form field values and validation errors separately. Validate on submit or field blur, store validation results in state, and conditionally render error messages. This approach keeps validation logic simple, accessible, and reactive to user input changes within the dialog.

Do I need Tailwind CSS to style Radix dialogs?

Radix dialogs are unstyled by default and work with any CSS framework or custom styles. Tailwind CSS is commonly paired with Radix for utility-first styling, but you can use CSS Modules, CSS-in-JS, or plain CSS. The choice depends on your project's design system and preferences.

How do I add loading and error handling to dialog form submissions?

Capture loading and error states from the tRPC mutation result. Disable the submit button during loading, display error messages conditionally, and show success feedback via toast notifications. This provides users with clear feedback on submission progress and outcomes.

When should I use a dialog versus other modal patterns for forms?

Dialogs are ideal for focused, interrupting tasks like create, edit, or delete operations that require user confirmation. Use dialogs when you need to block interaction with the page behind them. For non-blocking notifications or panels that slide in, consider alternatives like drawers, popovers, or inline forms.