command
aomi/commandFreeComponent
Fast, composable, unstyled command menu for React.
Install it
npx shadcn@latest add https://aomi.dev/r/command.jsonSource
1"use client";23import * as React from "react";4import { type DialogProps } from "@radix-ui/react-dialog";5import { Command as CommandPrimitive } from "cmdk";6import { Search } from "lucide-react";78import { cn } from "@aomi-labs/react";9import { Dialog, DialogContent } from "./dialog";1011const Command = React.forwardRef<12 React.ElementRef<typeof CommandPrimitive>,13 React.ComponentPropsWithoutRef<typeof CommandPrimitive>14>(({ className, ...props }, ref) => (15 <CommandPrimitive16 ref={ref}17 className={cn(18 "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",19 className,20 )}21 {...props}22 />23));24Command.displayName = CommandPrimitive.displayName;2526interface CommandDialogProps extends DialogProps {}2728const CommandDialog = ({ children, ...props }: CommandDialogProps) => {29 return (30 <Dialog {...props}>31 <DialogContent className="overflow-hidden p-0 shadow-lg">32 <Command className="[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[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">33 {children}34 </Command>35 </DialogContent>36 </Dialog>37 );38};3940const CommandInput = React.forwardRef<41 React.ElementRef<typeof CommandPrimitive.Input>,42 React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>43>(({ className, ...props }, ref) => (44 // eslint-disable-next-line react/no-unknown-property45 <div className="flex items-center border-b px-3" cmdk-input-wrapper="">46 <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />47 <CommandPrimitive.Input48 ref={ref}49 className={cn(50 "placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",51 className,52 )}53 {...props}54 />55 </div>56));5758CommandInput.displayName = CommandPrimitive.Input.displayName;5960const CommandList = React.forwardRef<61 React.ElementRef<typeof CommandPrimitive.List>,62 React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>63>(({ className, ...props }, ref) => (64 <CommandPrimitive.List65 ref={ref}66 className={cn("aui-command-list max-h-[300px] overflow-y-auto overflow-x-hidden", className)}67 {...props}68// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aomi
All 34 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | aomi | Components | Free | 2 deps | |
| alertalert | aomi | Components | Free | 1 dep | |
| aomi-frameaomi-frame | aomi | Components | Free | 1 dep | |
| aomi-para-provideraomi-para-provider | aomi | Components | Free | 9 deps · 27 files | |
| aomi-privy-provideraomi-privy-provider | aomi | Components | Free | 7 deps · 15 files | |
| aomi-wallet-kitaomi-wallet-kit | aomi | Components | Free | 8 deps · 59 files | |
| aomi-widgetaomi-widget | aomi | Components | Free | 2 deps | |
| assistant-threadassistant-thread | aomi | Components | Free | 6 deps · 23 files |
