BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-htmx/accordion

Accordion

shadcn-htmx/accordion
FreeComponent

Collapsible stacked sections. Native <details>/<summary> + new HTML name attribute for zero-JS exclusive accordion. APG keyboard nav in site.js.

Live preview

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

Install it

npx shadcn@latest add https://shadcn-htmx.productdevbook.com/r/accordion.json

Source

registry/ui/accordion.tsxshadcn-htmx.productdevbook.com/r/accordion.json
1/** @jsxImportSource hono/jsx */
2import type { PropsWithChildren } from "hono/jsx"
3import { cn, type ClassValue } from "@/registry/lib/cn"
4
5// Accordion — shadcn-htmx, htmx v4 + Tailwind v4.
6//
7// shadcn upstream uses Radix Accordion. We use the native HTML
8// <details><summary>...</summary>...</details>
9// so the platform gives us:
10// - Click / Space / Enter toggles open (browser default).
11// - aria-expanded mirrors the open attribute (browser-set on <summary>).
12// - <summary> is implicitly role="button" with accessible name from text.
13//
14// Native `<details name="...">` attribute (HTML Living Standard) makes the
15// group exclusive — opening one item closes the others, no JS required.
16// We use that for `type="single"`. For `type="multiple"` (the default) we
17// omit the name attribute and every item can be expanded independently.
18//
19// Public/site.js adds the APG keyboard contract on top:
20// - Down/Up Arrow: move focus between summaries in the same accordion.
21// - Home / End: focus first / last summary.
22//
23// Refs:
24// repos/mdn/files/en-us/web/html/reference/elements/details/index.md
25// repos/mdn/files/en-us/web/html/reference/elements/summary/index.md
26// repos/aria-practices/content/patterns/accordion/
27
28export type AccordionType = "single" | "multiple"
29
30type AccordionProps = PropsWithChildren<{
31 // Required so the exclusive-accordion `name` attribute can scope items.
32 id: string
33 type?: AccordionType
34 class?: ClassValue
35}>
36
37export function Accordion(props: AccordionProps) {
38 const { id, type = "multiple", class: className, children } = props
39 return (
40 <div
41 id={id}
42 data-slot="accordion"
43 data-accordion
44 data-type={type}
45 data-group-name={type === "single" ? id : undefined}
46 class={cn("w-full", className)}
47 >
48 {children}
49 </div>
50 )
51}
52
53type AccordionItemProps = PropsWithChildren<{
54 // Distinct value per item. Emitted as the `data-value` attribute so each
55 // item is individually identifiable; the boot script does not derive any
56 // aria-controls wiring from it. (Native <details>/<summary> is a disclosure
57 // widget where aria-controls is optional per the WAI-ARIA Disclosure
58 // pattern — repos/aria-practices/content/patterns/disclosure/.)
59 value: string
60 // Pre-open this item on initial render.
61 open?: boolean
62 disabled?: boolean
63 class?: ClassValue
64}>
65
66export function AccordionItem(props: AccordionItemProps) {
67// … truncated

Facts

Registry
shadcn-htmx
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

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

More from shadcn-htmx

All 83 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Active Searchactive-searchshadcn-htmxComponentsFreeno deps
Alertalertshadcn-htmxComponentsFreeno deps
Alert Dialogalert-dialogshadcn-htmxComponentsFreeno deps
Aspect Ratioaspect-ratioshadcn-htmxComponentsFreeno deps
Auto Gridauto-gridshadcn-htmxComponentsFreeno deps
Autocompleteautocompleteshadcn-htmxComponentsFreeno deps
Autosize Textareaautosize-textareashadcn-htmxComponentsFreeno deps
Avataravatarshadcn-htmxComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex