modal

Create and manage modal dialogs programmatically using createModal from @lobehub/ui.

81.4k|15.8k|Updated May 21, 2023
One-click install
npx skills add https://github.com/lobehub/lobehub --skill modal-lobehub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal
Source: https://github.com/lobehub/lobehub/tree/main/.agents/skills/modal
Command: npx skills add https://github.com/lobehub/lobehub --skill modal-lobehub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modal dialogs are often hard to manage with local state in complex UIs. This Skill enables imperative modal creation and control, allowing direct orchestration of dialogs via code.

Core Features & Use Cases

  • Imperative control: Create and control modals programmatically using createModal from @lobehub/ui.
  • Flexible content: Compose a modal with a dedicated content component, optional footer, width, and styling.
  • Use Case: Trigger modals in response to user actions, validation steps, or dynamic workflows within a feature.

Quick Start

Start by defining a content component and exporting a modal creator using createModal, then invoke the creator in response to a user action to display the modal with the configured title and options.

Frequently Asked Questions about modal

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

FAQPage Schema
How do I trigger a modal dialog programmatically in React without using local state?

You can trigger a modal dialog programmatically in React by using the imperative createModal API from @lobehub/ui, which allows direct orchestration of modals through code instead of managing complex local UI state.

What is the best way to manage modal dialogs in complex React frontend workflows?

The best way to manage modal dialogs in complex React frontend workflows is using imperative control, which enables you to directly trigger and configure modals in response to dynamic user actions or workflow steps without state prop drilling.

How to create a modal with custom content and title using an imperative API?

To create a modal with custom content and title, define a dedicated content component, then export a modal creator using the createModal API, passing your configuration options like title, width, and footer directly into the modal setup.

Does the createModal API support custom width and footer configurations for dialogs?

Yes, the createModal API supports custom width and footer configurations for dialogs, allowing you to define a specific modal configuration that includes styling, content components, and behavioral options for your React UI.

When should I use imperative modal control instead of declarative state management?

You should use imperative modal control instead of declarative state management when your UI components require dynamic modals triggered by user actions, validation steps, or workflow changes, making complex orchestration easier to manage directly in code.