BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/aurora/aurora-accordion

Aurora Accordion

aurora-dinglebear-ai/aurora-accordion
FreeComponent

Tokenized disclosure list for compact details, command output, and configuration sections.

Install it

npx shadcn@latest add https://aurora.dinglebear.ai/r/aurora-accordion.json

Source

registry/aurora/ui/accordion.tsxaurora.dinglebear.ai/r/aurora-accordion.json
1"use client"
2
3import * as React from "react"
4import * as AccordionPrimitive from "@radix-ui/react-accordion"
5import { ChevronDown } from "lucide-react"
6import { cn } from "@/lib/utils"
7
8export interface AuroraAccordionProps
9 extends Omit<
10 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>,
11 "children" | "collapsible" | "defaultValue" | "onValueChange" | "type" | "value"
12 > {
13 children: React.ReactNode
14 type?: "single" | "multiple"
15 collapsible?: boolean
16 defaultValue?: string | string[]
17 value?: string | string[]
18 onValueChange?: ((value: string) => void) | ((value: string[]) => void)
19 ref?: React.Ref<React.ComponentRef<typeof AccordionPrimitive.Root>>
20}
21
22export interface AuroraAccordionItemProps
23 extends Omit<
24 React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>,
25 "children" | "title" | "value"
26 > {
27 title: React.ReactNode
28 meta?: React.ReactNode
29 defaultOpen?: boolean
30 value?: string
31 children: React.ReactNode
32 ref?: React.Ref<React.ComponentRef<typeof AccordionPrimitive.Item>>
33}
34
35export type AccordionProps = AuroraAccordionProps
36export type AccordionItemProps = AuroraAccordionItemProps
37
38function Accordion({
39 ref,
40 children,
41 className,
42 type = "multiple",
43 collapsible = true,
44 defaultValue,
45 value,
46 onValueChange,
47 style,
48 ...props
49}: AuroraAccordionProps) {
50 const items = React.Children.toArray(children)
51
52 const normalizedChildren = items.map((child, index) => {
53 if (!React.isValidElement<AuroraAccordionItemProps>(child)) {
54 return child
55 }
56
57 return React.cloneElement(child, {
58 value: child.props.value ?? `accordion-item-${index}`,
59 })
60 })
61
62 const derivedDefaultValue = React.useMemo(() => {
63 if (defaultValue !== undefined) {
64 return defaultValue
65 }
66
67 const openValues = items.flatMap((child, index) => {
68 if (!React.isValidElement<AuroraAccordionItemProps>(child) || !child.props.defaultOpen) {
69 return []
70 }
71
72 return [child.props.value ?? `accordion-item-${index}`]
73 })
74
75 return type === "multiple" ? openValues : openValues[0]
76 }, [defaultValue, items, type])
77
78 const rootClassName = cn("overflow-hidden rounded-[12px] border", className)
79 const rootStyle = {
80 background: "var(--aurora-panel-medium)",
81 borderColor: "var(--aurora-border-default)",
82 ...style,
83 }
84
85 if (type === "multiple") {
86 return (
87 <AccordionPrimitive.Root
88 ref={ref}
89 data-slot="accordion"
90 type="multiple"
91// … truncated

What it pulls in

npm packages

  • @radix-ui/react-accordion@^1.2.16
  • lucide-react@^0.487.0

Other registry items

  • @aurora/aurora-tokens

Files it writes

  • registry/aurora/ui/accordion.tsx

Facts

Registry
aurora
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

aurora.dinglebear.ai dinglebear-ai/aurora on GitHub Raw registry item This item as JSON

More from aurora

All 176 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aurora Alert Dialogaurora-alert-dialogauroraComponentsFree2 deps
Aurora Aspect Ratioaurora-aspect-ratioauroraComponentsFreeno deps
Aurora Avataraurora-avatarauroraComponentsFree1 dep
Aurora Badgeaurora-badgeauroraComponentsFree2 deps
Aurora Banneraurora-bannerauroraComponentsFree1 dep
Aurora Breadcrumbaurora-breadcrumbauroraComponentsFree2 deps
Aurora Buttonaurora-buttonauroraComponentsFree2 deps
Aurora Button Groupaurora-button-groupauroraComponentsFreeno 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