Navigation & disclosure@neumorphism-ui/command

Command

Preserves cmdk filtering, active-item state, and keyboard navigation while rendering the input as inset and the active item as pressed. CommandDialog composes it with the existing Dialog.

@neumorphism-ui/command
Registry JSON

Preview

Saved state

Installation

Installation: commandnpx shadcn@latest add @neumorphism-ui/command

The CLI resolves npm dependencies, base tokens, utilities, and component source in order.

New to this Registry? Set up the namespace before continuing.

Usage

Import

Command import code
"use client";
import * as React from "react";
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandShortcut,
} from "@/components/ui/command";

Example

Command usage code
export default function Example() {
  const [selected, setSelected] = React.useState("No command selected.");
  return <div className="grid w-full max-w-md gap-3">
    <Command>
      <CommandInput placeholder="Search commands" />
      <CommandList>
        <CommandEmpty>No matching commands.</CommandEmpty>
        <CommandGroup heading="Navigation">
          <CommandItem value="dashboard" onSelect={() => setSelected("Dashboard")}>Dashboard<CommandShortcut>⌘D</CommandShortcut></CommandItem>
          <CommandItem value="settings" onSelect={() => setSelected("Settings")}>Settings<CommandShortcut>⌘,</CommandShortcut></CommandItem>
        </CommandGroup>
      </CommandList>
    </Command>
    <p role="status" className="text-sm text-[var(--muted-foreground)]">{selected}</p>
  </div>;
}

API Reference

ComponentPropTypeDefaultDescription
CommandshouldFilterbooleantrueControls whether cmdk applies its built-in search filtering.
Commandvalue / onValueChangestring / (value: string) => void—Controls the currently active item.
CommandInputvalue / onValueChangestring / (value: string) => void—Controls the search query or leaves the input uncontrolled.
CommandItemvalue / onSelectstring / (value: string) => void—Defines the searchable value and selection callback for an item.
CommandItemdisabledbooleanfalseKeeps an item in the result model while preventing selection.

Accessibility

  • 01

    Give CommandInput a placeholder or aria-label that describes the search purpose.

  • 02

    Arrow keys move the active item and Enter selects it; retain the visible focus treatment.

  • 03

    Provide an explicit CommandEmpty state when filtering returns no items.