Command
blode-ui/commandFreeComponent
A command palette for fast, keyboard-driven searching and navigation.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/mblode/blode-ui/main/public/r/command.jsonSource
1"use client";23import { SearchIcon } from "blode-icons-react";4import { Command as CommandPrimitive } from "cmdk";5import type * as React from "react";67import { cn } from "@/lib/utils";8import {9 Dialog,10 DialogContent,11 DialogDescription,12 DialogHeader,13 DialogTitle,14} from "@/components/ui/dialog";1516const Command = ({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) => (17 <CommandPrimitive18 className={cn(19 "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",20 className,21 )}22 data-slot="command"23 {...props}24 />25);2627const CommandDialog = ({28 title = "Command Palette",29 description = "Search for a command to run...",30 children,31 className,32 showCloseButton = true,33 ...props34}: React.ComponentProps<typeof Dialog> & {35 title?: string;36 description?: string;37 children?: React.ReactNode;38 className?: string;39 showCloseButton?: boolean;40}) => (41 <Dialog {...props}>42 <DialogHeader className="sr-only">43 <DialogTitle>{title}</DialogTitle>44 <DialogDescription>{description}</DialogDescription>45 </DialogHeader>46 <DialogContent47 className={cn("overflow-hidden p-0", className)}48 showCloseButton={showCloseButton}49 >50 <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">51 {children}52 </Command>53 </DialogContent>54 </Dialog>55);5657const CommandInput = ({58 className,59 ...props60}: React.ComponentProps<typeof CommandPrimitive.Input>) => (61 <div className="flex h-9 items-center gap-2 border-b px-3" data-slot="command-input-wrapper">62 <SearchIcon className="size-4 shrink-0 opacity-50" />63 <CommandPrimitive.Input64 className={cn(65 "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",66 className,67 )}68 data-slot="command-input"69 {...props}70 />71 </div>72);7374const CommandList = ({75 className,76 ...props77}: React.ComponentProps<typeof CommandPrimitive.List>) => (78 <CommandPrimitive.List79 className={cn(80// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from blode/ui
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blode/ui | Components | Free | 2 deps | |
| Alertalert | blode/ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | blode/ui | Components | Free | 1 dep | |
| Ask User Questionsask-user-questions | blode/ui | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | blode/ui | Components | Free | 1 dep | |
| Attachmentattachment | blode/ui | Components | Free | 1 dep | |
| Autocompleteautocomplete | blode/ui | Components | Free | 1 dep | |
| Avataravatar | blode/ui | Components | Free | 1 dep |
