Agent skill · Frontend

modal

LobeHub imperative modal conventions. Use when creating or migrating modals, dialogs, popups, confirm flows, ModalHost wiring, createModal, confirmModal, useModalContext, or base-ui modal APIs.

LobeHub80,937★ · +310/wk · 1 repos on radarProfile →
claude-codeNOASSERTION
Install
npx skills add lobehub/lobehub --skill modal --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 4 KB
Bundled scripts: none
Path: .agents/skills/modal/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 81,252 · +315 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Modal Imperative API Guide ## Recommended: `@lobehub/ui/base-ui` New code should use the **base-ui** modal stack (headless primitives, not antd `Modal`): - `createModal`, `confirmModal`, `ModalHost` from `@lobehub/ui/base-ui` - `useModalContext` from `@lobehub/ui/base-ui` inside modal **content** Body slot: pass **`content`** (or `children`; runtime uses `content ?? children`). ### Global `ModalHost` (required) Base-ui `createModal` renders through a **separate** host from the root package. The app must mount **`ModalHost`** from `@lobehub/ui/base-ui` once near the root (e.g. next to other global hosts). Without it, `createModal` calls will not appear. If the project only mounts `ModalHost` from `@lobehub/ui`, add a second lazy `ModalHost` from `@lobehub/ui/base-ui` until all imperative modals are migrated. ### Why imperative? | Mode | Characteristics | Recommended | | ----------- | ------------------------------------ | ----------- | | Declarative | `open` state + `<Modal />` | ❌ | | Imperative | Call `createModal()`, no local state | ✅ | ### File structure ``` features/ └── MyFeatureModal/ ├── index.tsx # export createXxxModal └── MyFeatureContent.tsx # modal body ``` ### 1. Co

What's inside
Steps it walks through
  1. Recommended: @lobehub/ui/base-ui
  2. Global ModalHost (required)
  3. Why imperative?
  4. File structure
  5. 1. Content (MyFeatureContent.tsx)
  6. 2. createModal (index.tsx)
  7. 3. Usage
  8. i18n
  9. useModalContext
  10. Common options (base-ui)
  11. Confirm
  12. Legacy: @lobehub/ui (root)
  13. Examples
More from lobehub
All skills →
About this skill
What does the modal skill do?

LobeHub imperative modal conventions. Use when creating or migrating modals, dialogs, popups, confirm flows, ModalHost wiring, createModal, confirmModal, useModalContext, or base-ui modal APIs.

How do I install it?

Run `npx skills add lobehub/lobehub --skill modal --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From lobehub/lobehub, a repository with 81,252 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going