Command based on Lina's Radix UI variant
lina/command-radixFreeComponent
A command component built using Lina's Radix UI
Install it
npx shadcn@latest add https://lina.sameer.sh/r/command-radix.jsonSource
1"use client";23import * as React from "react";4import { ScrollArea } from "@/registry/radix-ui/scroll-area";56import { Command as CommandPrimitive } from "cmdk";7import { SearchIcon } from "lucide-react";89import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";1011import { cn } from "@/lib/utils";1213function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {14 return (15 <CommandPrimitive16 data-slot="command"17 className={cn("bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-md", className)}18 {...props}19 />20 );21}2223function CommandDialog({24 title = "Command Palette",25 description = "Search for a command to run...",26 children,27 ...props28}: React.ComponentProps<typeof Dialog> & {29 title?: string;30 description?: string;31}) {32 return (33 <Dialog {...props}>34 <DialogHeader className="sr-only">35 <DialogTitle>{title}</DialogTitle>36 <DialogDescription>{description}</DialogDescription>37 </DialogHeader>38 <DialogContent className="overflow-hidden p-0 sm:max-w-lg [&>button:last-child]:hidden">39 <Command className="[&_[cmdk-group-heading]]:text-muted-foreground max-h-[100svh] **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-3 [&_[cmdk-item]]:py-2">40 {children}41 </Command>42 </DialogContent>43 </Dialog>44 );45}4647function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {48 return (49 <div className="border-input flex items-center border-b px-5" cmdk-input-wrapper="">50 <SearchIcon size={20} className="text-muted-foreground/80 me-3" />51 <CommandPrimitive.Input52 data-slot="command-input-wrapper"53 className={cn(54 "placeholder:text-muted-foreground/70 flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",55 className56 )}57 {...props}58 />59 </div>60 );61}6263function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {64 return (65 <ScrollArea66 maskClassName="before:from-popover after:from-popover"67 className="flex max-h-full flex-col overflow-hidden"68 >69// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lina
All 10 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Command based on Lina's Base UI variantcommand-base | lina | Components | Free | 2 deps | |
| Horizontal Scroll Area Base Demohorizontal-scroll-demo-base | lina | Components | Free | no deps | |
| Horizontal Scroll Area Radix Demohorizontal-scroll-demo-radix | lina | Components | Free | no deps | |
| Base UI Adaptive Scroll Arealina-base | lina | Components | Free | 1 dep · 2 files | |
| Radix Adaptive Scroll Arealina-radix | lina | Components | Free | 1 dep · 2 files | |
| Timezone Select Base UI Demotimezone-select-demo-base | lina | Components | Free | 1 dep | |
| Timezone Select Radix Demotimezone-select-demo-radix | lina | Components | Free | 1 dep | |
| Vertical Scroll Area Base Demovertical-scroll-demo-base | lina | Components | Free | no deps |
