BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/gmhlab/item

item

gmhlab/item
FreeComponent

gmhlab publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/gmhlab/monorepo/main/packages/ui/public/r/item.json

Source

registry/new-york/ui/item.tsxraw.githubusercontent.com/gmhlab/monorepo/main/packages/ui/public/r/item.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3import { Slot } from "radix-ui"
4
5import { cn } from "@/lib/utils"
6import { Separator } from "@/components/ui/separator"
7
8function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9 return (
10 <div
11 role="list"
12 data-slot="item-group"
13 className={cn("group/item-group flex flex-col", className)}
14 {...props}
15 />
16 )
17}
18
19function ItemSeparator({
20 className,
21 ...props
22}: React.ComponentProps<typeof Separator>) {
23 return (
24 <Separator
25 data-slot="item-separator"
26 orientation="horizontal"
27 className={cn("my-0", className)}
28 {...props}
29 />
30 )
31}
32
33const itemVariants = cva(
34 "group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 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: "p-4 gap-4 ",
44 sm: "py-3 px-4 gap-2.5",
45 },
46 },
47 defaultVariants: {
48 variant: "default",
49 size: "default",
50 },
51 }
52)
53
54function Item({
55 className,
56 variant = "default",
57 size = "default",
58 asChild = false,
59 ...props
60}: React.ComponentProps<"div"> &
61 VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62 const Comp = asChild ? Slot.Root : "div"
63 return (
64 <Comp
65 data-slot="item"
66 data-variant={variant}
67 data-size={size}
68 className={cn(itemVariants({ variant, size, className }))}
69 {...props}
70 />
71 )
72}
73
74const itemMediaVariants = cva(
75 "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
76 {
77 variants: {
78 variant: {
79 default: "bg-transparent",
80 icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
81 image:
82 "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
83 },
84 },
85 defaultVariants: {
86 variant: "default",
87 },
88 }
89)
90
91function ItemMedia({
92 className,
93 variant = "default",
94 ...props
95}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
96 return (
97 <div
98// … truncated

What it pulls in

npm packages

  • class-variance-authority
  • radix-ui

Other registry items

  • separator

Files it writes

  • registry/new-york/ui/item.tsx

Facts

Registry
gmhlab
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
2 days ago

Go to the source

gwglobalmentalhealth.com gmhlab/monorepo on GitHub Raw registry item This item as JSON

More from gmhlab

All 64 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordiongmhlabComponentsFree2 deps
alertalertgmhlabComponentsFree1 dep
alert-dialogalert-dialoggmhlabComponentsFree1 dep
aspect-ratioaspect-ratiogmhlabComponentsFree1 dep
avataravatargmhlabComponentsFree1 dep
badgebadgegmhlabComponentsFree2 deps
breadcrumbbreadcrumbgmhlabComponentsFree2 deps
buttonbuttongmhlabComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex