use-modal-control-query
A hook that opens and closes shadcn/ui dialogs, sheets and drawers from URL query parameters.
- Category
- Libraries & Components
- Added
About
About use-modal-control-query
use-modal-control-query is a hook for controlling modal components through query parameters. Instead of holding open state in a component, the URL carries it, so a link or a page reload can bring a dialog back. The demo page shows a simple example, a version that keeps extra state in the query, and a set of compatible components.
The hook works with Dialog, Sheet, Drawer, Dropdown Menu, Select and Collapsible. It lives in the davidsling shadcn registry, a growing set of shadcn/ui components and hooks, and installs through the shadcn CLI as source you own. Use it when sharing a deep link to an open modal matters, or when you want several triggers to open the same one.
use-modal-control-query features
5 features
- Modal open state stored in the query string
- Works with Dialog, Sheet and Drawer
- Works with Dropdown Menu, Select and Collapsible
- Query-stored state example
- Installs through the shadcn CLI
Install use-modal-control-query
1 command
Terminal
$ pnpm dlx shadcn@latest add https://shadcn.davidsling.in/r/use-modal-control-query.jsonWhat you can build with use-modal-control-query
3 use cases
- Sharing a link that opens a specific edit dialog
- Keeping a drawer open across a page reload
- Opening one dialog from several buttons
Links
1 link
Libraries & Components
Similar to use-modal-control-query
More libraries & components like use-modal-control-query: the closest by what they do, then the most starred.
Shadcn Tree ViewLibraryShadcn Tree View renders hierarchical lists with expandable nodes, custom icons, drag and drop and disabled items, installed through the shadcn CLI.
DropDrawerLibraryDropDrawer swaps a shadcn/ui dropdown menu for a drawer on small screens, supports nested submenus, and installs through the shadcn CLI.
scificn-uiLibraryRetro sci-fi component library for React in a Cassette Futurism style. Built on Radix UI and Tailwind CSS v4, installed through the shadcn CLI.
hookagainLibraryhookagain packages React hooks like useDebouncedValue, useLocalStorage and useMediaQuery as shadcn registry items you install with one command.
carouselcnLibrarycarouselcn is a copy-paste carousel for React and Tailwind CSS with CSS transitions, drag and swipe, looping, indicators and ARIA labels. MIT licensed.
audiocnLibraryaudiocn offers audio components for shadcn/ui: a mixer, faders, knobs, level meters, waveforms and a player. Add them with the CLI and own the code.
Pricing
Ship it with Pro
The directory is free. Pro adds 6,000+ blocks, 14 premium templates and the MCP server, so your AI editor installs them for you.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
FAQ
Frequently asked questions
What use-modal-control-query is, how to install it, its license and its alternatives.
The demo lists Dialog, Sheet, Drawer, Dropdown Menu, Select and Collapsible.
A hook that opens and closes shadcn/ui dialogs, sheets and drawers from URL query parameters.
use-modal-control-query lists Modal open state stored in the query string, Works with Dialog, Sheet and Drawer, Works with Dropdown Menu, Select and Collapsible, Query-stored state example and Installs through the shadcn CLI.
The directory lists these uses for use-modal-control-query: Sharing a link that opens a specific edit dialog, Keeping a drawer open across a page reload and Opening one dialog from several buttons.
The directory does not name a maker for use-modal-control-query. Its site is https://shadcn.davidsling.in/hooks/use-modal-control-query.
use-modal-control-query was added to the directory on November 2, 2025.
use-modal-control-query is in Libraries & Components. Component libraries and standalone components built on shadcn/ui, covering the data tables, pickers, editors and charts the core set leaves out.
Registry, Components, shadcn CLI, Copy and paste and Navigation. Each tag has a page listing the other resources that carry it.
Yes. use-modal-control-query's page has a Live tab beside the screenshot that loads its site in a frame.
Run the shadcn CLI add command with the use-modal-control-query.json URL from the davidsling registry. The page shows variants for pnpm, npx, yarn and bun.
use-modal-control-query lists this command: `pnpm dlx shadcn@latest add https://shadcn.davidsling.in/r/use-modal-control-query.json`. Its docs are at https://shadcn.davidsling.in/hooks/use-modal-control-query.
Yes, according to its listing: use-modal-control-query installs with `pnpm dlx shadcn@latest add https://shadcn.davidsling.in/r/use-modal-control-query.json`.
The directory links no repository for use-modal-control-query. Its site is https://shadcn.davidsling.in/hooks/use-modal-control-query.
use-modal-control-query's docs are at https://shadcn.davidsling.in/hooks/use-modal-control-query.
The directory records no license for use-modal-control-query. Check its repository or site before you use it.
The directory records no price for use-modal-control-query. Its site, https://shadcn.davidsling.in/hooks/use-modal-control-query, is where its pricing, if any, is stated.
No. use-modal-control-query is made by its own maker and listed here as a link. A shadcn.io Pro plan covers shadcn.io's own blocks, templates and tools.
Other resources in Libraries & Components, newest first: Shadcn Tree View, DropDrawer, scificn-ui and hookagain. Their pages are linked under Similar to use-modal-control-query.
Open its category, Libraries & Components, or one of its tags (Registry, Components and shadcn CLI): each page lists the resources that share it.
4.9 out of 5 from 150+ developers
Found your stack? Ship it.
6,000+ blocks, premium templates and MCP in every Pro plan. The directory stays free.
Get Pro



