Command

Command offers an accessible interface to build keyboard-driven menus, search fields, and autocomplete inputs by combining input handling, navigation, and selection.

Example

Usage

Installation

Install following dependencies:

npm install react-aria-components tw-animate-css tailwindcss-react-aria-components class-variance-authority lucide-react clsx tailwind-merge motion

Add cn helper using clsx and twMerge for conditional class merging in Tailwind components.

lib/utils.ts

Copy and paste the following code into your project.

components/ui/core/command.tsx
npx libravelui@latest add command

Anatomy

import {
  Command,
  CommandInput,
  CommandList,
  CommandGroup,
  CommandItem,
  CommandSeparator,
} from "@/components/ui/core/command";
<Command>
  <CommandInput placeholder="Placeholder belongs here" />
  <CommandList>
    <CommandGroup title="Group Title">
      <CommandItem textValue="Item One">
        <span>Item One</span>
      </CommandItem>
      <CommandItem textValue="Item Two">
        <span>Item Two</span>
      </CommandItem>
    </CommandGroup>

    <CommandSeparator />

    <CommandGroup title="Another Group">
      <CommandItem textValue="Item Three" tone="destructive">
        <span>Item Three</span>
      </CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Another Example

With Modal

A Command component rendered inside a modal for focused, searchable selection.

Usage

Props

Loading types…

Accessible React component library to copy, customize, and own your UI. Built for Next.js, Vite, and Laravel.

Crafted by dervyon. Peep the Source Code on GitHub.

Hosted on Vercel. The source code's got the MIT license.

2025 - 2026 · LibravelUI

Starter Kits

Templates

    Coming Soon

Labs