Skip to content

DataCommand

A data-driven command component that loads items from an API and supports nested commands.

shadcn.davidsling.in/components/data-command

DataCommand website screenshot
Added

About

About DataCommand

DataCommand is a command palette component built on top of shadcn/ui. Instead of a static list, you give it a loadItems function that returns CommandDataItem objects, so items can come from an API, and it supports nested commands and instant search. A loadOneItem function plus a defaultPath prop lets it open with a prefilled chain before any full fetch happens.

It is published on the slingcn registry by David Sling. Install it with pnpm dlx shadcn@latest add and the data-command.json URL; npx, yarn, bun and antfu/ni variants are shown. The docs include minimal and API examples, each with its own install command, plus live previews. It suits search-heavy tools such as project switchers, admin consoles and documentation sites that need a command menu backed by server data.

DataCommand features

6 features

  • Async item loading with loadItems
  • Nested command chains
  • Instant search
  • Prefilled chain via defaultPath and loadOneItem
  • Per-example install commands
  • Built on the shadcn/ui command component

Install DataCommand

1 command

Terminal

$ pnpm dlx shadcn@latest add https://shadcn.davidsling.in/r/data-command.json

What you can build with DataCommand

3 use cases

  • Searching projects from an API in a command menu
  • Building a nested navigation palette for an admin tool
  • Opening a palette on a deep path without loading every item

1 link

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 DataCommand is, how to install it, its license and its alternatives.

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