Prodular UI

Overlays

Command

A searchable list of actions and destinations, used inline or as a cmd+K palette, with groups, shortcuts and a hint footer.

npx prodular-ui add command

Palette

Input, grouped results with shortcuts, and a footer with keyboard hints.

NavigateOpenEscClose

Command dialog

Press the button or cmd+K. The dialog sits high on the screen, so results grow downward.

Anatomy

<CommandDialog open={open} onOpenChange={setOpen}>  <Command>    <CommandInput placeholder="Search or run a command" />    <CommandList>      <CommandEmpty>No results.</CommandEmpty>      <CommandGroup heading="Actions">        <CommandItem>          <PlusIcon />          Create issue          <CommandShortcut>C</CommandShortcut>        </CommandItem>      </CommandGroup>    </CommandList>    <CommandFooter>{/* keyboard hints */}</CommandFooter>  </Command></CommandDialog>

Guidance

Use it when

  • Use as a global cmd+K palette for navigation and actions in apps with many pages.
  • Use inline inside a Popover for searchable pickers with more than about ten options.

Avoid

  • Short lists. Use Dropdown menu or Select.
  • Free text search over content that needs filters and pagination. Build a search page.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Inside CommandDialog, render a Command with CommandInput, CommandList and optionally CommandFooter.
  • Always include CommandEmpty with a sentence that suggests what to search for.
  • Group results with CommandGroup heading in sentence case: Actions, Go to, Recent.
  • Set value on CommandItem when the visible label is not what people type, for example an issue id plus its title.
  • Close the dialog in onSelect after running the action.
  • Register the cmd+K and ctrl+K listener once at the app level, not per page.

API

CommandDialog

PropTypeDefaultDescription
open / onOpenChangeboolean / (open: boolean) => voidControlled state of the palette.
title / descriptionstring"Command palette"Screen reader title and description.

CommandItem

PropTypeDefaultDescription
valuestringText used for filtering. Defaults to the item's text.
onSelect(value: string) => voidRuns on click or Enter.

Command

PropTypeDefaultDescription
shouldFilterbooleantrueSet to false when you filter on the server.