item
skeuomorph-krzysztof/itemFreeComponent
skeuomorph-krzysztof publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by skeuomorph-krzysztof on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://skeuomorph.krzysztof.studio/r/styles/new-york/item.jsonSource
1import * as React from "react"2import { Slot } from "@radix-ui/react-slot"3import { cva, type VariantProps } from "class-variance-authority"45import { cn } from "@/lib/utils"6import { Separator } from "@/registry/new-york/ui/separator"78function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {9 return (10 <div11 role="list"12 data-slot="item-group"13 className={cn("group/item-group flex flex-col", className)}14 {...props}15 />16 )17}1819function ItemSeparator({20 className,21 ...props22}: React.ComponentProps<typeof Separator>) {23 return (24 <Separator25 data-slot="item-separator"26 orientation="horizontal"27 className={cn("my-0", className)}28 {...props}29 />30 )31}3233const itemVariants = cva(34 "group/item [a]:hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring/50 [a]:transition-colors flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-colors duration-100 focus-visible:ring-[3px]",35 {36 variants: {37 variant: {38 default: "bg-transparent",39 outline: "border-border",40 muted: "bg-muted/50",41 },42 size: {43 default: "gap-4 p-4 ",44 sm: "gap-2.5 px-4 py-3",45 },46 },47 defaultVariants: {48 variant: "default",49 size: "default",50 },51 }52)5354function Item({55 className,56 variant = "default",57 size = "default",58 asChild = false,59 ...props60}: React.ComponentProps<"div"> &61 VariantProps<typeof itemVariants> & { asChild?: boolean }) {62 const Comp = asChild ? Slot : "div"63 return (64 <Comp65 data-slot="item"66 data-variant={variant}67 data-size={size}68 className={cn(itemVariants({ variant, size, className }))}69 {...props}70 />71 )72}7374const itemMediaVariants = cva(75 "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",76 {77 variants: {78 variant: {79 default: "bg-transparent",80 icon: "bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4",81 image:82 "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",83 },84 },85 defaultVariants: {86 variant: "default",87 },88 }89)9091function ItemMedia({92 className,93 variant = "default",94 ...props95}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {96 return (97// … truncated
What it pulls in
Other registry items
Files it writes
More from skeuomorph-krzysztof
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | skeuomorph-krzysztof | Components | Free | 1 dep | |
| alertalert | skeuomorph-krzysztof | Components | Free | no deps | |
| alert-dialogalert-dialog | skeuomorph-krzysztof | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | skeuomorph-krzysztof | Components | Free | 1 dep | |
| avataravatar | skeuomorph-krzysztof | Components | Free | 1 dep | |
| badgebadge | skeuomorph-krzysztof | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | skeuomorph-krzysztof | Components | Free | 1 dep | |
| buttonbutton | skeuomorph-krzysztof | Components | Free | 1 dep |
