BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-zhcndoc/accordion

accordion

shadcn-zhcndoc/accordion
FreeComponent

shadcn-zhcndoc publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn-zhcndoc on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shadcn.zhcndoc.com/r/styles/new-york/accordion.json

Source

ui/accordion.tsxshadcn.zhcndoc.com/r/styles/new-york/accordion.json
1"use client"
2
3import * as React from "react"
4import * as AccordionPrimitive from "@radix-ui/react-accordion"
5import { ChevronDown } from "lucide-react"
6
7import { cn } from "@/lib/utils"
8
9const Accordion = AccordionPrimitive.Root
10
11const AccordionItem = React.forwardRef<
12 React.ElementRef<typeof AccordionPrimitive.Item>,
13 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
14>(({ className, ...props }, ref) => (
15 <AccordionPrimitive.Item
16 ref={ref}
17 className={cn("border-b", className)}
18 {...props}
19 />
20))
21AccordionItem.displayName = "AccordionItem"
22
23const AccordionTrigger = React.forwardRef<
24 React.ElementRef<typeof AccordionPrimitive.Trigger>,
25 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
26>(({ className, children, ...props }, ref) => (
27 <AccordionPrimitive.Header className="flex">
28 <AccordionPrimitive.Trigger
29 ref={ref}
30 className={cn(
31 "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
32 className
33 )}
34 {...props}
35 >
36 {children}
37 <ChevronDown className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
38 </AccordionPrimitive.Trigger>
39 </AccordionPrimitive.Header>
40))
41AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
42
43const AccordionContent = React.forwardRef<
44 React.ElementRef<typeof AccordionPrimitive.Content>,
45 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
46>(({ className, children, ...props }, ref) => (
47 <AccordionPrimitive.Content
48 ref={ref}
49 className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
50 {...props}
51 >
52 <div className={cn("pb-4 pt-0", className)}>{children}</div>
53 </AccordionPrimitive.Content>
54))
55AccordionContent.displayName = AccordionPrimitive.Content.displayName
56
57export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }

Files it writes

  • ui/accordion.tsx

Facts

Registry
shadcn-zhcndoc
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on shadcn-zhcndoc shadcn.zhcndoc.com zhcndoc/shadcn on GitHub Raw registry item This item as JSON

More from shadcn-zhcndoc

All 61 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
alertalertshadcn-zhcndocComponentsFreeno deps
alert-dialogalert-dialogshadcn-zhcndocComponentsFreeno deps
aspect-ratioaspect-ratioshadcn-zhcndocComponentsFreeno deps
attachmentattachmentshadcn-zhcndocComponentsFreeno deps
avataravatarshadcn-zhcndocComponentsFreeno deps
badgebadgeshadcn-zhcndocComponentsFreeno deps
breadcrumbbreadcrumbshadcn-zhcndocComponentsFreeno deps
bubblebubbleshadcn-zhcndocComponentsFreeno 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