
Description
modal is an agent skill from the LobeHub repository that explains how to open modals, dialogs and confirmations with the imperative modal API. New code should use the base-ui modal stack from @lobehub/ui/base-ui rather than the antd Modal, and the skill names the three APIs to use: createModal, confirmModal and ModalHost, along with useModalContext inside modal content. The body of a modal takes content, or children as a fallback. The most important rule is the global host. The base-ui createModal renders through its own host, not the one exported from the root package, so the app must mount ModalHost from @lobehub/ui/base-ui once near the root, next to other global hosts. Without it, createModal calls do not appear. If a project mounts only the root ModalHost, the skill says to add a second lazy ModalHost from @lobehub/ui/base-ui until all imperative modals have moved over. The guide also explains why the imperative style is used. It is for contributors who build a dialog or a confirmation prompt in the LobeHub codebase, or who migrate older modals. The skill passes Gen Agent Trust Hub, Socket and Snyk on skills.sh. Install it with npx skills add https://github.com/lobehub/lobehub --skill modal.…
Highlights
- Imperative modal API with createModal and confirmModal
- Recommends @lobehub/ui/base-ui over the antd Modal
- Explains the global ModalHost that must be mounted once
- Covers migrating older modals in steps
Ratings & Reviews
No ratings yet
Be the first to rate modal.
People also visit
modal FAQ
What should new modals use?
The base-ui modal stack from @lobehub/ui/base-ui, with createModal, confirmModal and ModalHost.
Why is a modal not appearing?
The app must mount ModalHost from @lobehub/ui/base-ui once near the root. Without it, createModal calls do not show.
What if the project mounts only the root ModalHost?
Add a second lazy ModalHost from @lobehub/ui/base-ui until every imperative modal has been migrated.
How do I install it?
Run npx skills add https://github.com/lobehub/lobehub --skill modal.
Which security audits does it have?
On skills.sh, Gen Agent Trust Hub, Socket and Snyk all pass.
What are the best modal alternatives?
Popular alternatives to modal include add-provider-doc, add-setting-env and debug. See all modal alternatives


