Item
glasswave/itemFreeComponent
List row with optional glass variant and media slot.
Live preview
live · rendered by the registry
Rendered by glasswave on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://glasswave.denizisik.com/r/item.jsonSource
1"use client";23import { Slot } from "@radix-ui/react-slot";4import { forwardRef } from "react";5import { cn } from "@/lib/utils";6import { glass } from "@/lib/glass";78export const Item = forwardRef<9 HTMLDivElement,10 React.ComponentProps<"div"> & {11 asChild?: boolean;12 variant?: "default" | "glass";13 }14>(({ asChild, className, variant = "default", ...props }, ref) => {15 const Comp = asChild ? Slot : "div";16 return (17 <Comp18 ref={ref}19 data-slot="item"20 data-variant={variant}21 className={cn(22 "flex w-full items-center gap-3 rounded-2xl px-3 py-2.5 text-left text-sm transition-colors",23 variant === "default" &&24 "hover:bg-black/[0.04] dark:hover:bg-white/[0.08] dark:hover:bg-white/[0.08]",25 variant === "glass" && glass,26 className,27 )}28 {...props}29 />30 );31});32Item.displayName = "Item";3334export function ItemMedia({35 className,36 variant = "icon",37 ...props38}: React.ComponentProps<"div"> & { variant?: "icon" | "image" }) {39 return (40 <div41 data-slot="item-media"42 data-variant={variant}43 className={cn(44 "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-xl border border-black/[0.08] dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.05] [&_svg]:size-5",45 variant === "image" && "border-0 bg-transparent p-0",46 className,47 )}48 {...props}49 />50 );51}5253export function ItemContent({54 className,55 ...props56}: React.ComponentProps<"div">) {57 return (58 <div59 data-slot="item-content"60 className={cn("flex min-w-0 flex-1 flex-col gap-0.5", className)}61 {...props}62 />63 );64}6566export function ItemTitle({67 className,68 ...props69}: React.ComponentProps<"div">) {70 return (71 <div72 data-slot="item-title"73 className={cn(74 "truncate font-medium leading-tight text-current",75 className,76 )}77 {...props}78 />79 );80}8182export function ItemDescription({83 className,84 ...props85}: React.ComponentProps<"p">) {86 return (87 <p88 data-slot="item-description"89 className={cn("truncate text-xs text-current/60 leading-snug", className)}90 {...props}91 />92 );93}9495export function ItemActions({96 className,97 ...props98}: React.ComponentProps<"div">) {99 return (100 <div101 data-slot="item-actions"102 className={cn("flex shrink-0 items-center gap-1", className)}103 {...props}104 />105 );106}
What it pulls in
npm packages
Other registry items
Files it writes
More from glasswave
All 60 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | glasswave | Components | Free | 2 deps | |
| Alertalert | glasswave | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | glasswave | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | glasswave | Components | Free | 1 dep | |
| Avataravatar | glasswave | Components | Free | 1 dep | |
| Badgebadge | glasswave | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | glasswave | Components | Free | 2 deps | |
| Buttonbutton | glasswave | Components | Free | 2 deps |
