Accordion
boldkit/accordionFreeComponent
A vertically stacked set of interactive headings with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/accordion.jsonSource
1import * as React from 'react'2import * as AccordionPrimitive from '@radix-ui/react-accordion'3import { ChevronDown } from 'lucide-react'4import { cn } from '@/lib/utils'56const Accordion = AccordionPrimitive.Root78const AccordionItem = React.forwardRef<9 React.ElementRef<typeof AccordionPrimitive.Item>,10 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>11>(({ className, ...props }, ref) => (12 <AccordionPrimitive.Item13 ref={ref}14 className={cn('border-3 border-foreground border-b-0 last:border-b-3 shadow-[4px_4px_0px_hsl(var(--shadow-color))]', className)}15 {...props}16 />17))18AccordionItem.displayName = 'AccordionItem'1920const AccordionTrigger = React.forwardRef<21 React.ElementRef<typeof AccordionPrimitive.Trigger>,22 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>23>(({ className, children, ...props }, ref) => (24 <AccordionPrimitive.Header className="flex">25 <AccordionPrimitive.Trigger26 ref={ref}27 className={cn(28 'flex flex-1 items-center justify-between bg-background py-4 px-4 font-bold uppercase tracking-wide transition duration-200 hover:bg-muted [&[data-state=open]]:bg-accent [&[data-state=open]>svg]:rotate-180',29 className30 )}31 {...props}32 >33 {children}34 <ChevronDown className="h-5 w-5 shrink-0 stroke-[3] transition-transform duration-200" />35 </AccordionPrimitive.Trigger>36 </AccordionPrimitive.Header>37))38AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName3940const AccordionContent = React.forwardRef<41 React.ElementRef<typeof AccordionPrimitive.Content>,42 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>43>(({ className, children, ...props }, ref) => (44 <AccordionPrimitive.Content45 ref={ref}46 className="overflow-hidden text-sm transition data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down border-t-3 border-foreground"47 {...props}48 >49 <div className={cn('p-4', className)}>{children}</div>50 </AccordionPrimitive.Content>51))52AccordionContent.displayName = AccordionPrimitive.Content.displayName5354export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps | |
| Buttonbutton | boldkit | Components | Free | 2 deps |
