modal

Create and manage modal dialogs programmatically with @lobehub/ui.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/mabdulrauf/wazone-back --skill modal-mabdulrauf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal
Source: https://github.com/mabdulrauf/wazone-back/tree/main/.agents/skills/modal
Command: npx skills add https://github.com/mabdulrauf/wazone-back --skill modal-mabdulrauf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Imperative API that enables developers to create and control modal dialogs programmatically using createModal from @lobehub/ui. It replaces declarative modal setup with a direct, on-demand approach.

Core Features & Use Cases

  • Imperative modal creation with configurable options (allowFullscreen, destroyOnHidden, footer, width).
  • Content and interaction isolation via dedicated content components and useModalContext for closing and interaction.
  • Practical use in React projects needing on-demand modals tied to dynamic data, with i18n-friendly titles.

Quick Start

Call createMyFeatureModal() to open the modal.

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 a React app instead of using declarative state?

To create imperative modals in React, use the createModal API to programmatically open dialogs on demand. It replaces declarative state management by allowing you to call a function directly to render the modal content and manage its lifecycle.

What is the best way to manage dynamic modal content and interactions in React?

Managing dynamic modal content is best handled by passing dedicated content components to createModal. You can use the useModalContext hook within these components to handle interactions and close the modal without prop drilling.

Can I configure fullscreen mode and custom footers for modals using @lobehub/ui?

Yes, you can configure fullscreen mode and custom footers using @lobehub/ui modals. The createModal options object supports properties like allowFullscreen, footer, width, and destroyOnHidden to customize the dialog behavior.

Does the imperative modal API support destroying hidden components to prevent memory leaks?

Yes, the imperative modal API supports destroying hidden components to prevent memory leaks. By setting the destroyOnHidden option in createModal, the modal content is unmounted and cleaned up when the dialog is closed.

How do I close an on-demand modal from within a child component in React?

To close an on-demand modal from a child component, use the useModalContext hook provided by the modal system. This context exposes specific functions that allow nested content components to trigger the modal closure directly.