n-modal

Implement modal dialogs and overlays in Naive UI with useModal.

8|3|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/jiaiyan/naive-ui-skills --skill n-modal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n-modal
Source: https://github.com/jiaiyan/naive-ui-skills/tree/main/components/n-modal
Command: npx skills add https://github.com/jiaiyan/naive-ui-skills --skill n-modal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modal overlays and dialogs enable focused user interactions without navigating away from the page, simplifying tasks like confirmations, forms, and detail views.

Core Features & Use Cases

  • Built-in presets such as card and dialog for quick modal setup
  • Imperative API via useModal to create and control modals programmatically
  • Draggable support to reposition modals within the viewport
  • Flexible customization of size, position, and masking behavior
  • Mask control and focus trapping for accessible, reliable UX

Use cases include confirmations, content details, multi-step workflows, and floating panels.

Quick Start

Use the n-modal component or the useModal API to display a modal in a Vue app.

Frequently Asked Questions about n-modal

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

FAQPage Schema
How do I create a draggable modal dialog in Vue3?

You can create a draggable modal dialog in Vue3 by utilizing the built-in draggable support to reposition modals within the viewport. It also provides mask control and focus trapping for reliable UX.

What is an imperative API for modals and how does it work in Naive UI?

An imperative API for modals allows you to create and control dialogs programmatically. In Naive UI, the useModal API enables you to trigger and manage modal overlays directly from your component logic.

Can I use presets to quickly set up overlays and dialogs in Naive UI?

Yes, you can use presets to quickly set up overlays and dialogs in Naive UI. Built-in presets such as 'card' and 'dialog' enable fast modal configuration for confirmations, forms, and detail views.

Does Naive UI modal support mask control and accessible focus trapping?

Yes, Naive UI modal supports mask control and accessible focus trapping. These features ensure reliable UX by managing masking behavior and trapping focus within the active dialog overlay.

What are the limitations of using imperative modals for multi-step workflows?

When using imperative modals for multi-step workflows, limitations may arise from complex state management across steps. While the useModal API handles configurable props and positioning, intricate workflows require careful focus management.