modal

Standardize imperative modal management in React apps using base-ui primitives.

Updated May 11, 2026
One-click install
npx skills add https://github.com/zmh13928433602-sys/lobe-chat --skill modal-zmh13928433602-sys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal
Source: https://github.com/zmh13928433602-sys/lobe-chat/tree/main/.agents/skills/modal
Command: npx skills add https://github.com/zmh13928433602-sys/lobe-chat --skill modal-zmh13928433602-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardize and simplify imperative modal management in React apps by using a unified set of base-ui modal primitives.

Core Features & Use Cases

  • Create: Use createModal / confirmModal to spawn modals without local state.
  • Hosting: Ensure a single global ModalHost is mounted near the app root for consistent rendering.
  • Migration: Guides migrating from legacy Modal usage to base-ui primitives across features.

Quick Start

Call the modal factory to render the content using createModal.

Frequently Asked Questions about modal

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

FAQPage Schema
How do I create imperative modals in React without managing local state?

Migrate legacy modal usage to base-ui primitives by replacing local state declarations with createModal and confirmModal factories. This standardizes UI layers requiring confirmations or step-by-step dialogs, ensuring consistent rendering through a globally mounted root ModalHost.

What are base-ui modal primitives and how do they standardize UI overlays?

Base-ui modal primitives like createModal, confirmModal, ModalHost, and useModalContext standardize imperative modal management in React apps. They provide a unified API to spawn confirmations and overlays without local state, ensuring consistent rendering through a globally mounted root ModalHost.

Do I need a specific component mounted to use imperative modal factories?

Yes, using imperative modal factories requires a single global ModalHost mounted near the React app root. This root ModalHost ensures modals created via createModal or confirmModal render consistently across your application without requiring local state management.

What is the best way to migrate from legacy modal usage to base-ui primitives?

The best way to migrate from legacy modal usage is to adopt base-ui primitives like createModal and confirmModal. Replace local state-driven modal logic with these imperative factories, and ensure a root ModalHost is mounted near the app root to handle consistent rendering.

Can I use imperative modals for step-by-step dialogs and confirmations?

Yes, you can use imperative modals for step-by-step dialogs and confirmations. The base-ui primitives, specifically createModal and confirmModal, are designed to spawn these UI layers imperatively without relying on local component state.