@eluan/core 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/README.md +33 -1
  2. package/dist/{action-popover-D6K9aVFk.cjs → action-popover-DrHKPGqw.cjs} +1 -1
  3. package/dist/{action-popover-BVJQBuky.js → action-popover-NkXDAHJT.js} +1 -1
  4. package/dist/action-popover.cjs +1 -1
  5. package/dist/action-popover.js +1 -1
  6. package/dist/{avatar-Co-k8KqV.cjs → avatar-B-t3ctR4.cjs} +1 -1
  7. package/dist/{avatar-CS5f1irF.js → avatar-kDEa0rjF.js} +1 -1
  8. package/dist/avatar.cjs +1 -1
  9. package/dist/avatar.js +1 -1
  10. package/dist/{badge-D9NYZFWH.js → badge-BLZ8V-KC.js} +10 -10
  11. package/dist/{badge-DXKWztL-.cjs → badge-D1A0Tc79.cjs} +1 -1
  12. package/dist/badge.cjs +1 -1
  13. package/dist/badge.js +1 -1
  14. package/dist/{banner-COlEFRuK.cjs → banner-CNdwDPqA.cjs} +1 -1
  15. package/dist/{banner-CyYFLZXw.js → banner-DzSp5WfQ.js} +9 -9
  16. package/dist/banner.cjs +1 -1
  17. package/dist/banner.js +1 -1
  18. package/dist/box-DG-tkaYi.cjs +1 -0
  19. package/dist/box-DKbNgGGG.js +17 -0
  20. package/dist/box.cjs +1 -0
  21. package/dist/box.d.ts +1 -0
  22. package/dist/box.js +5 -0
  23. package/dist/{breadcrumb-NWXeCH5q.cjs → breadcrumb-BuxXkm6O.cjs} +1 -1
  24. package/dist/{breadcrumb-Cm1nb9Xj.js → breadcrumb-C6qj-tDx.js} +1 -1
  25. package/dist/breadcrumb.cjs +1 -1
  26. package/dist/breadcrumb.js +1 -1
  27. package/dist/button--_WI-fM6.cjs +1 -0
  28. package/dist/{button-ANAPDrvs.js → button-DNSNShUc.js} +28 -26
  29. package/dist/button.cjs +1 -1
  30. package/dist/button.js +1 -1
  31. package/dist/{calendar-BpBsomy5.js → calendar-BA2tSwZD.js} +6 -6
  32. package/dist/{calendar-7LX5YGGT.cjs → calendar-DS5821-k.cjs} +3 -3
  33. package/dist/calendar.cjs +1 -1
  34. package/dist/calendar.js +1 -1
  35. package/dist/{card-C88--zB4.cjs → card-BNdR5aDa.cjs} +1 -1
  36. package/dist/{card-BC_4C3ns.js → card-BSgN7WSe.js} +1 -1
  37. package/dist/card.cjs +1 -1
  38. package/dist/card.js +1 -1
  39. package/dist/{carousel-BfL7oy_q.cjs → carousel-4AERgboz.cjs} +1 -1
  40. package/dist/{carousel-DuP0hvF-.js → carousel-Bb7jpzep.js} +1 -1
  41. package/dist/carousel.cjs +1 -1
  42. package/dist/carousel.js +1 -1
  43. package/dist/{checkbox-Bi0Kmuut.js → checkbox-CGUTGery.js} +1 -1
  44. package/dist/{checkbox-M8DmWKiC.cjs → checkbox-Cq9sHU_S.cjs} +1 -1
  45. package/dist/{checkbox-group-KBwPhjmW.cjs → checkbox-group-DGXZ4o2-.cjs} +1 -1
  46. package/dist/{checkbox-group-CQMEJnhD.js → checkbox-group-Tkio3IhK.js} +1 -1
  47. package/dist/checkbox-group.cjs +1 -1
  48. package/dist/checkbox-group.js +1 -1
  49. package/dist/checkbox.cjs +1 -1
  50. package/dist/checkbox.js +1 -1
  51. package/dist/{command-BCl0seLL.cjs → command-D02vvta9.cjs} +1 -1
  52. package/dist/{command-Chs5VlBL.js → command-sUMAxm8S.js} +1 -1
  53. package/dist/command.cjs +1 -1
  54. package/dist/command.js +1 -1
  55. package/dist/components/box.d.ts +12 -0
  56. package/dist/components/grid.d.ts +35 -0
  57. package/dist/components/icon.d.ts +26 -0
  58. package/dist/components/layout-shared.d.ts +307 -0
  59. package/dist/components/navigation-drawer.d.ts +25 -5
  60. package/dist/components/row.d.ts +18 -0
  61. package/dist/components/stack.d.ts +14 -0
  62. package/dist/components/tone-shared.d.ts +39 -0
  63. package/dist/components/typography.d.ts +22 -2
  64. package/dist/components/visually-hidden.d.ts +11 -0
  65. package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-9VPlzvDm.js} +1 -1
  66. package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-DppPJBne.cjs} +1 -1
  67. package/dist/credit-card-input.cjs +1 -1
  68. package/dist/credit-card-input.js +1 -1
  69. package/dist/{date-picker-ni8td8Ru.js → date-picker-M5hLx_1s.js} +2 -2
  70. package/dist/{date-picker-DGBsfZXx.cjs → date-picker-hE7cDg2B.cjs} +1 -1
  71. package/dist/date-picker.cjs +1 -1
  72. package/dist/date-picker.js +1 -1
  73. package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-BeRUPJ7s.cjs} +1 -1
  74. package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CIqBZYMH.js} +3 -3
  75. package/dist/datetime-picker.cjs +1 -1
  76. package/dist/datetime-picker.js +1 -1
  77. package/dist/{decimal-input-yTk35W_5.js → decimal-input-Bg2BPKIr.js} +38 -38
  78. package/dist/decimal-input-CkTEjo2J.cjs +1 -0
  79. package/dist/decimal-input.cjs +1 -1
  80. package/dist/decimal-input.js +1 -1
  81. package/dist/{dialog-B8eWKqzS.js → dialog-Bsfviqvy.js} +2 -2
  82. package/dist/dialog-DRAoumvB.cjs +1 -0
  83. package/dist/dialog.cjs +1 -1
  84. package/dist/dialog.js +1 -1
  85. package/dist/{email-input-DFI4h_KN.cjs → email-input-CehmtNUq.cjs} +1 -1
  86. package/dist/{email-input-pX0hlYV3.js → email-input-DIiY9Q3S.js} +1 -1
  87. package/dist/email-input.cjs +1 -1
  88. package/dist/email-input.js +1 -1
  89. package/dist/{footer-DB0_-IwN.cjs → footer-fovIsy-0.cjs} +1 -1
  90. package/dist/{footer-B3KUIwXW.js → footer-jWaFq3qk.js} +9 -9
  91. package/dist/footer.cjs +1 -1
  92. package/dist/footer.js +1 -1
  93. package/dist/grid-BDz4Xs6M.cjs +1 -0
  94. package/dist/grid-BX5vZjDo.js +612 -0
  95. package/dist/grid.cjs +1 -0
  96. package/dist/grid.d.ts +1 -0
  97. package/dist/grid.js +5 -0
  98. package/dist/{header-CDOWlOAR.js → header-Dnf8AnIx.js} +2 -2
  99. package/dist/{header-CiZQY_7S.cjs → header-DzItWqW4.cjs} +1 -1
  100. package/dist/header.cjs +1 -1
  101. package/dist/header.js +1 -1
  102. package/dist/icon-BmLOodCQ.cjs +1 -0
  103. package/dist/icon-BwDfkIdR.js +153 -0
  104. package/dist/icon.cjs +1 -0
  105. package/dist/icon.d.ts +1 -0
  106. package/dist/icon.js +5 -0
  107. package/dist/index.cjs +10 -5
  108. package/dist/index.d.ts +6 -0
  109. package/dist/index.js +612 -541
  110. package/dist/{input-BrGJn-D9.cjs → input-BcjL2oxv.cjs} +1 -1
  111. package/dist/{input-Cccufiqn.js → input-CPb9yVU5.js} +8 -8
  112. package/dist/input-otp-BhJ3ERrY.cjs +1 -0
  113. package/dist/{input-otp-DmEGB1nu.js → input-otp-CTvJztkH.js} +32 -32
  114. package/dist/input-otp.cjs +1 -1
  115. package/dist/input-otp.js +1 -1
  116. package/dist/input.cjs +1 -1
  117. package/dist/input.js +1 -1
  118. package/dist/layout-shared-B_1iX4Hj.js +319 -0
  119. package/dist/layout-shared-CsBZcT4V.cjs +1 -0
  120. package/dist/{multi-select-B6NBbDCW.js → multi-select-CVxkWW29.js} +30 -30
  121. package/dist/multi-select-DBFINH3F.cjs +1 -0
  122. package/dist/multi-select.cjs +1 -1
  123. package/dist/multi-select.js +1 -1
  124. package/dist/navigation-drawer-BCBFtLEq.cjs +1 -0
  125. package/dist/navigation-drawer-BMyHXhhX.js +198 -0
  126. package/dist/navigation-drawer.cjs +1 -1
  127. package/dist/navigation-drawer.js +1 -1
  128. package/dist/{number-input-vICbRc2y.js → number-input-Cm9YPBOX.js} +1 -1
  129. package/dist/{number-input-Bc7jUsu-.cjs → number-input-Dr9MbuRV.cjs} +1 -1
  130. package/dist/number-input.cjs +1 -1
  131. package/dist/number-input.js +1 -1
  132. package/dist/{pagination-DTWRjiOm.js → pagination-D2tjMpVU.js} +2 -2
  133. package/dist/{pagination-4IuE_APs.cjs → pagination-yKmFlFMR.cjs} +1 -1
  134. package/dist/pagination.cjs +1 -1
  135. package/dist/pagination.js +1 -1
  136. package/dist/{password-input-BwnlHPbX.cjs → password-input-CmHubHuU.cjs} +1 -1
  137. package/dist/{password-input-B9V45d3Q.js → password-input-ljwdGCO6.js} +2 -2
  138. package/dist/password-input.cjs +1 -1
  139. package/dist/password-input.js +1 -1
  140. package/dist/{phone-input-BQjZj5jI.cjs → phone-input-B8VksCer.cjs} +1 -1
  141. package/dist/{phone-input-CSBpGHvI.js → phone-input-qTL6K8rT.js} +2 -2
  142. package/dist/phone-input.cjs +1 -1
  143. package/dist/phone-input.js +1 -1
  144. package/dist/progress-BpdmBGaX.cjs +1 -0
  145. package/dist/{progress-Dz_it5I-.js → progress-ChFf9bIq.js} +1 -1
  146. package/dist/progress.cjs +1 -1
  147. package/dist/progress.js +1 -1
  148. package/dist/providers/create-theme.d.ts +10 -1
  149. package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
  150. package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
  151. package/dist/radio-group.cjs +1 -1
  152. package/dist/radio-group.js +1 -1
  153. package/dist/{rich-text-BZSyuYSo.js → rich-text-DImwK9hN.js} +1 -1
  154. package/dist/{rich-text-DerWxzdn.cjs → rich-text-DzHLeG7W.cjs} +1 -1
  155. package/dist/rich-text.cjs +1 -1
  156. package/dist/rich-text.js +1 -1
  157. package/dist/row-BYAk7G5d.js +37 -0
  158. package/dist/row-Bjn-GQAC.cjs +1 -0
  159. package/dist/row.cjs +1 -0
  160. package/dist/row.d.ts +1 -0
  161. package/dist/row.js +5 -0
  162. package/dist/{search-input-Dmmo-BEL.cjs → search-input-BKTjebg7.cjs} +1 -1
  163. package/dist/{search-input-bFNW6oiE.js → search-input-Dgr9kT1a.js} +1 -1
  164. package/dist/search-input.cjs +1 -1
  165. package/dist/search-input.js +1 -1
  166. package/dist/select-Cdh991T-.cjs +1 -0
  167. package/dist/{select-DDSYjKtj.js → select-Dp5AJ6I-.js} +15 -15
  168. package/dist/select.cjs +1 -1
  169. package/dist/select.js +1 -1
  170. package/dist/sheet-CkXjinUG.cjs +1 -0
  171. package/dist/{sheet-D5HWF66e.js → sheet-uiyHNKEw.js} +6 -6
  172. package/dist/sheet.cjs +1 -1
  173. package/dist/sheet.js +1 -1
  174. package/dist/{slider-CZQBAXup.js → slider-BQmbh0Nl.js} +1 -1
  175. package/dist/{slider-DdEOapYP.cjs → slider-DK2yk-YK.cjs} +1 -1
  176. package/dist/slider.cjs +1 -1
  177. package/dist/slider.js +1 -1
  178. package/dist/stack-Ck1w2iJu.cjs +1 -0
  179. package/dist/stack-D2btWM1t.js +27 -0
  180. package/dist/stack.cjs +1 -0
  181. package/dist/stack.d.ts +1 -0
  182. package/dist/stack.js +5 -0
  183. package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
  184. package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
  185. package/dist/stepper.cjs +1 -1
  186. package/dist/stepper.js +1 -1
  187. package/dist/styles.css +935 -59
  188. package/dist/{switch-KzBijHMJ.cjs → switch-C2OPCq5Z.cjs} +1 -1
  189. package/dist/{switch-C7EBLT5H.js → switch-CXBWUZcq.js} +3 -3
  190. package/dist/switch.cjs +1 -1
  191. package/dist/switch.js +1 -1
  192. package/dist/{tabs-DztJ2iVc.cjs → tabs-D8p6Tr5i.cjs} +1 -1
  193. package/dist/{tabs-C9NKBmH0.js → tabs-TV4_2wi1.js} +9 -9
  194. package/dist/tabs.cjs +1 -1
  195. package/dist/tabs.js +1 -1
  196. package/dist/{textarea-Dl-daLHR.cjs → textarea-BnpQmE74.cjs} +1 -1
  197. package/dist/{textarea-DXUk1b_-.js → textarea-CJRmnazN.js} +1 -1
  198. package/dist/textarea.cjs +1 -1
  199. package/dist/textarea.js +1 -1
  200. package/dist/{time-input-BPoFvoeM.js → time-input-A603mEFQ.js} +38 -38
  201. package/dist/time-input-qxljhdEb.cjs +1 -0
  202. package/dist/time-input.cjs +1 -1
  203. package/dist/time-input.js +1 -1
  204. package/dist/{toggle-Dv1VZ5Le.js → toggle-Bx3q15Pu.js} +6 -6
  205. package/dist/{toggle-Bvh1v32T.cjs → toggle-Z3t4jPdv.cjs} +1 -1
  206. package/dist/{toggle-group-SyHMwO90.cjs → toggle-group-BZIW4wJp.cjs} +1 -1
  207. package/dist/{toggle-group-DE8BPZih.js → toggle-group-LaZmOMx_.js} +7 -7
  208. package/dist/toggle-group.cjs +1 -1
  209. package/dist/toggle-group.js +1 -1
  210. package/dist/toggle.cjs +1 -1
  211. package/dist/toggle.js +1 -1
  212. package/dist/{tree-view-CyeJR7cW.js → tree-view-DRmm6oL6.js} +23 -23
  213. package/dist/tree-view-DVQyRQDg.cjs +1 -0
  214. package/dist/tree-view.cjs +1 -1
  215. package/dist/tree-view.js +1 -1
  216. package/dist/visually-hidden-BQMRYGxP.js +14 -0
  217. package/dist/visually-hidden-DzxxOswl.cjs +1 -0
  218. package/dist/visually-hidden.cjs +1 -0
  219. package/dist/visually-hidden.d.ts +1 -0
  220. package/dist/visually-hidden.js +5 -0
  221. package/package.json +8 -8
  222. package/skills/eluan/DESIGN.md +409 -0
  223. package/skills/eluan/SKILL.md +166 -0
  224. package/skills/eluan/components/accordion.md +212 -0
  225. package/skills/eluan/components/action-popover.md +266 -0
  226. package/skills/eluan/components/aspect-ratio.md +169 -0
  227. package/skills/eluan/components/avatar.md +277 -0
  228. package/skills/eluan/components/badge.md +190 -0
  229. package/skills/eluan/components/banner.md +247 -0
  230. package/skills/eluan/components/box.md +166 -0
  231. package/skills/eluan/components/breadcrumb.md +240 -0
  232. package/skills/eluan/components/button.md +214 -0
  233. package/skills/eluan/components/calendar.md +192 -0
  234. package/skills/eluan/components/card.md +270 -0
  235. package/skills/eluan/components/carousel.md +274 -0
  236. package/skills/eluan/components/checkbox-group.md +228 -0
  237. package/skills/eluan/components/checkbox.md +226 -0
  238. package/skills/eluan/components/code-block.md +193 -0
  239. package/skills/eluan/components/collapsible.md +240 -0
  240. package/skills/eluan/components/command.md +359 -0
  241. package/skills/eluan/components/context-menu.md +296 -0
  242. package/skills/eluan/components/credit-card-input.md +217 -0
  243. package/skills/eluan/components/date-picker.md +255 -0
  244. package/skills/eluan/components/date-time-picker.md +196 -0
  245. package/skills/eluan/components/decimal-input.md +232 -0
  246. package/skills/eluan/components/dialog.md +322 -0
  247. package/skills/eluan/components/drawer.md +292 -0
  248. package/skills/eluan/components/dropdown-menu.md +450 -0
  249. package/skills/eluan/components/email-input.md +200 -0
  250. package/skills/eluan/components/fieldset.md +219 -0
  251. package/skills/eluan/components/file-input.md +249 -0
  252. package/skills/eluan/components/footer.md +290 -0
  253. package/skills/eluan/components/form-label.md +254 -0
  254. package/skills/eluan/components/grid.md +192 -0
  255. package/skills/eluan/components/header.md +242 -0
  256. package/skills/eluan/components/hover-card.md +215 -0
  257. package/skills/eluan/components/icon.md +161 -0
  258. package/skills/eluan/components/input-otp.md +227 -0
  259. package/skills/eluan/components/input.md +249 -0
  260. package/skills/eluan/components/kbd.md +216 -0
  261. package/skills/eluan/components/media.md +244 -0
  262. package/skills/eluan/components/menubar.md +300 -0
  263. package/skills/eluan/components/multi-select.md +221 -0
  264. package/skills/eluan/components/navigation-drawer.md +297 -0
  265. package/skills/eluan/components/navigation-menu.md +291 -0
  266. package/skills/eluan/components/number-input.md +190 -0
  267. package/skills/eluan/components/pagination.md +262 -0
  268. package/skills/eluan/components/password-input.md +218 -0
  269. package/skills/eluan/components/phone-input.md +205 -0
  270. package/skills/eluan/components/popover.md +250 -0
  271. package/skills/eluan/components/progress.md +185 -0
  272. package/skills/eluan/components/radio-group.md +232 -0
  273. package/skills/eluan/components/rich-text.md +195 -0
  274. package/skills/eluan/components/row.md +174 -0
  275. package/skills/eluan/components/scroll-area.md +203 -0
  276. package/skills/eluan/components/search-input.md +281 -0
  277. package/skills/eluan/components/segmented-control.md +201 -0
  278. package/skills/eluan/components/select.md +296 -0
  279. package/skills/eluan/components/separator.md +179 -0
  280. package/skills/eluan/components/sheet.md +326 -0
  281. package/skills/eluan/components/skeleton.md +202 -0
  282. package/skills/eluan/components/slider.md +195 -0
  283. package/skills/eluan/components/spinner.md +187 -0
  284. package/skills/eluan/components/stack.md +158 -0
  285. package/skills/eluan/components/stepper.md +236 -0
  286. package/skills/eluan/components/switch.md +218 -0
  287. package/skills/eluan/components/table.md +348 -0
  288. package/skills/eluan/components/tabs.md +277 -0
  289. package/skills/eluan/components/textarea.md +202 -0
  290. package/skills/eluan/components/time-input.md +181 -0
  291. package/skills/eluan/components/toast.md +251 -0
  292. package/skills/eluan/components/toggle-group.md +241 -0
  293. package/skills/eluan/components/toggle.md +198 -0
  294. package/skills/eluan/components/tooltip.md +222 -0
  295. package/skills/eluan/components/tree-view.md +213 -0
  296. package/skills/eluan/components/typography.md +207 -0
  297. package/skills/eluan/components/visually-hidden.md +132 -0
  298. package/skills/eluan/foundations/colour.md +252 -0
  299. package/skills/eluan/foundations/elevation.md +57 -0
  300. package/skills/eluan/foundations/iconography.md +70 -0
  301. package/skills/eluan/foundations/motion.md +60 -0
  302. package/skills/eluan/foundations/radius.md +61 -0
  303. package/skills/eluan/foundations/spacing.md +98 -0
  304. package/skills/eluan/foundations/theming.md +197 -0
  305. package/skills/eluan/foundations/typography.md +163 -0
  306. package/skills/eluan/patterns/empty-states.md +84 -0
  307. package/skills/eluan/patterns/feedback.md +95 -0
  308. package/skills/eluan/patterns/forms.md +138 -0
  309. package/skills/eluan/patterns/navigation.md +95 -0
  310. package/skills/eluan/patterns/page-layout.md +101 -0
  311. package/dist/button-Ny6OF8Un.cjs +0 -1
  312. package/dist/decimal-input-BLmifKF2.cjs +0 -1
  313. package/dist/dialog-DWYtFhZl.cjs +0 -1
  314. package/dist/input-otp-DcZ7wyjs.cjs +0 -1
  315. package/dist/multi-select-kcoUbSwE.cjs +0 -1
  316. package/dist/navigation-drawer-BbeDYPhu.js +0 -171
  317. package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
  318. package/dist/progress-DpQjGEyn.cjs +0 -1
  319. package/dist/select-1Eb3NSrR.cjs +0 -1
  320. package/dist/sheet-7NP1LuHy.cjs +0 -1
  321. package/dist/time-input-DR2snTgB.cjs +0 -1
  322. package/dist/tree-view-CNvEc1TT.cjs +0 -1
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: eluan
3
+ description: Build UI with the Eluan design system. Use whenever creating, editing or reviewing interface code in a project that depends on Eluan (@eluan/core, @eluan/tokens, @eluan/theme-generator), including pages, forms, layouts, theming, or picking which component to use.
4
+ ---
5
+
6
+ # Eluan
7
+
8
+ Eluan is a React design system: 74 components in `@eluan/core`, styled with StyleX and themed through CSS custom properties from `@eluan/tokens`. Components read semantic tokens; your theme sets them.
9
+
10
+ Install: `pnpm add @eluan/core @eluan/tokens`
11
+ Import: `import { Button } from "@eluan/core"`
12
+
13
+ Set up once at the app entry:
14
+
15
+ ```tsx
16
+ import "@eluan/core/styles.css";
17
+ import { EluanProvider } from "@eluan/core";
18
+
19
+ export function App({ children }: { children: React.ReactNode }) {
20
+ return <EluanProvider defaultTheme="minimal">{children}</EluanProvider>;
21
+ }
22
+ ```
23
+
24
+ ## Rules
25
+
26
+ These always apply.
27
+
28
+ 1. Use tokens for every colour, space, radius and type value. Never write raw hex, rgb, oklch, px or rem values.
29
+ 2. Use an existing Eluan component before building anything custom. Check the index below first.
30
+ 3. Never override focus styles, contrast pairs or keyboard behaviour.
31
+ 4. Read a component's file before using it for the first time in a task.
32
+ 5. Read the matching foundation file before making any visual decision.
33
+ 6. The theme is generated. Change the theme, never individual component colours.
34
+ 7. Never pass `className` or `style` to an Eluan component. Most drop them; the few that forward them (Toast, and parts that are plain Radix re-exports such as the Tabs root, menu Group, Portal and Sub parts, NavigationMenuLink) aren't a supported styling path, and on Toast they replace Eluan's styling. Lay components out with Stack, Row, Grid and Box; put anything those don't cover (position, overflow, a fixed width) on a wrapper element you own.
35
+ 8. Use the semantic token layer (`--container-*`, `--interactive-*`, `--action-*`, tone tokens, `--spacing-*`, `--size-*`, `--curves-*`, `--font-size-*`). Never use primitives such as `--color-mono-500` or `--spacing-space-4`.
36
+ 9. Import components and theme helpers from `@eluan/core` only. Don't import `@radix-ui/*` primitives or `@eluan/tokens` when Eluan wraps or re-exports them.
37
+ 10. Eluan has no shadow or motion tokens yet. Don't add `box-shadow`, transitions or animations; use the component's own props (for example Card `elevation`).
38
+
39
+ Lay out with the layout primitives: [Stack](components/stack.md), [Row](components/row.md), [Grid](components/grid.md) and [Box](components/box.md), whose `gap` and `pad` props take `--spacing-*` steps by name, and [Icon](components/icon.md) for icon sizes. For what they don't cover, style your own element with CSS that reads tokens: a stylesheet, CSS modules, StyleX, or an inline style object. Some older examples here lay out with inline-styled `div`s; prefer the primitives.
40
+
41
+ ## How to work
42
+
43
+ 1. Find the task's intent in the decision tree.
44
+ 2. Read the pattern file it points to, if any.
45
+ 3. Read each component file you'll use.
46
+ 4. Read foundations for any visual choice the components don't settle.
47
+ 5. Build. Then check your output against each component's Rules and Don'ts.
48
+
49
+ ## Decision tree
50
+
51
+ | If the task is to… | Read | Then use |
52
+ | --- | --- | --- |
53
+ | Collect input from the user | `patterns/forms.md` | Input, Textarea, Select, Checkbox, RadioGroup, Switch, Label, Fieldset, Button |
54
+ | Tell the user something happened | `patterns/feedback.md` | Toast for transient confirmation, Banner for persistent or blocking messages, FormMessage for a field |
55
+ | Ask the user to confirm | `components/dialog.md` | Dialog, never a custom modal |
56
+ | Let the user move between views | `patterns/navigation.md` | Tabs, Header, NavigationMenu, NavigationDrawer, Breadcrumb, Pagination |
57
+ | Lay out a page or show a collection | `patterns/page-layout.md` | Table for comparing, Card for browsing, Accordion for long secondary content |
58
+ | Show that there's nothing yet | `patterns/empty-states.md` | Typography and one Button, composed |
59
+ | Pick a date or time | `components/date-picker.md` | DatePicker, DateRangePicker, DateTimePicker, TimeInput, Calendar |
60
+ | Offer a menu of actions | `components/dropdown-menu.md` | DropdownMenu, ContextMenu, ActionPopover, Menubar |
61
+ | Show more content without leaving the page | `components/sheet.md` | Sheet, Drawer, Popover, HoverCard, Tooltip |
62
+ | Search by a typed query, or run a command | `components/search-input.md` | SearchInput, Command |
63
+ | Filter a list by fields (date range, status, tags) | `patterns/forms.md`, then the field's component | Select, MultiSelect, DateRangePicker, SegmentedControl |
64
+ | Show status or progress | `components/badge.md` | Badge, Progress, Spinner, Skeleton |
65
+ | Set text | `components/typography.md` | Typography |
66
+ | Change the look of the product | `foundations/theming.md` | the theme generator output, `createTheme`, Provider axes |
67
+
68
+ ## Component index
69
+
70
+ <!-- index:start -->
71
+ | Component | Use when | Instead, use | File |
72
+ | --- | --- | --- | --- |
73
+ | Accordion | Stacking several sections of secondary content the user may skip, each expanded from its own header, such as an FAQ or advanced settings. | Collapsible for a single show/hide region; Tabs for switching between peer views; Card or headings for content everyone needs. | `components/accordion.md` |
74
+ | ActionPopover | A table row, list item or card needs a compact "more actions" menu behind a three-dots button. | DropdownMenu when you need separators, groups, submenus, checkable items or a custom trigger; inline Buttons for one or two actions; Popover for a panel with form content. | `components/action-popover.md` |
75
+ | AspectRatio | Content you own (an embed, map, canvas or placeholder) must keep a fixed width-to-height ratio as its container resizes. | Image or Video ratio presets for images and videos; a hard-coded height on your own element. | `components/aspect-ratio.md` |
76
+ | Avatar | Showing a person or account as a small circular image with initials as the fallback, optionally with a presence dot or notification count. | Media or Image for content pictures; Badge for status without a person; a plain img for profile pictures. | `components/avatar.md` |
77
+ | Badge | Labelling the status or category of an item, such as Active, Draft, Failed or Beta. | Toast or Banner for messages; Avatar's AvatarStatus for presence; Button or Toggle for anything clickable; Progress, Spinner or Skeleton for loading. | `components/badge.md` |
78
+ | Banner | A message must stay visible until it's resolved: a form-level error, an account or page notice, or a blocking problem. | Toast for transient confirmation; FormMessage for a single field; Badge for an item's status; Dialog when the user must decide. | `components/banner.md` |
79
+ | Box | One element needs token padding, or needs to take the remaining space in a Row or Stack, without laying out children of its own. | Stack or Row when the element also places several children; Card when the block needs a surface, border or radius. | `components/box.md` |
80
+ | Breadcrumb | A page sits two or more levels deep in a hierarchy and the user needs to see where they are and step back up. | NavigationDrawer or NavigationMenu for primary navigation; Stepper for steps in a process; Button variant link with asChild for a single Back link. | `components/breadcrumb.md` |
81
+ | Button | The user triggers an action, submits a form or opens an overlay. | Link or your router's link for navigation (Button asChild only to style one); Toggle or Switch for on/off state; DropdownMenu for a list of actions. | `components/button.md` |
82
+ | Calendar | A month grid stays visible on the page for picking one date, several dates or a range. | DatePicker or DateRangePicker for a date field in a form or filter bar; DateTimePicker when the time matters too. | `components/calendar.md` |
83
+ | Card | Grouping content about one item or topic on its own surface, such as a project, a plan or a settings group. | Table for items compared across the same attributes; Fieldset for a group of form fields; Dialog or Sheet for content over the page. | `components/card.md` |
84
+ | Carousel | Showing a row of similar slides the user pages through one or a few at a time, such as screenshots, testimonials or featured items. | Card grid when every item should be visible; Tabs for switching views; Stepper for an ordered process. | `components/carousel.md` |
85
+ | CheckboxGroup | The user picks any number of options from a short, visible list, such as notification channels or permissions. | RadioGroup when only one option can be chosen; MultiSelect for long or searchable lists; Switch rows for settings that apply immediately. | `components/checkbox-group.md` |
86
+ | Checkbox | A single yes/no choice the user confirms when they submit a form, such as accepting terms, or a select-all control above a list. | Switch for settings that apply immediately; CheckboxGroup for a labelled list of options; RadioGroup when only one option can be chosen. | `components/checkbox.md` |
87
+ | CodeBlock | Showing a multi-line code sample, config file or command with syntax highlighting and a copy button. | Kbd for keyboard keys; an inline code element with the mono font for code inside a sentence; Textarea for code the user edits. | `components/code-block.md` |
88
+ | Collapsible | One region of the page shows and hides in place behind a single trigger, such as advanced options or extra details. | Accordion for several stacked sections; Tabs for switching views; Popover, Sheet or Drawer for content that should float or slide in. | `components/collapsible.md` |
89
+ | Command | A searchable, keyboard-driven list of commands or options, as a Cmd+K palette (CommandDialog), an inline filterable list or a searchable picker in a Popover. | Select for a short fixed list; MultiSelect for several choices; SearchInput for a plain search field; DropdownMenu for a few actions behind a button. Eluan has no Combobox; Command is that primitive. | `components/command.md` |
90
+ | ContextMenu | Right-click or long-press on a surface (a file tile, canvas or row) should offer actions for that thing. | DropdownMenu or ActionPopover for a visible actions button; Menubar for an app-wide File/Edit bar; Select to pick a value. | `components/context-menu.md` |
91
+ | CreditCardInput | Your app collects card number, expiry and security code in its own fields and needs formatting and brand detection. | Your payment provider's hosted card fields when it offers them; Input for any other text; NumberInput for quantities. | `components/credit-card-input.md` |
92
+ | DatePicker | The user picks one date (DatePicker) or a start and end date (DateRangePicker) in a form or filter bar. | Input type=date or a hand-built Popover and Calendar; DateTimePicker when a time is needed; TimeInput for a time alone; Calendar for an always-visible grid. | `components/date-picker.md` |
93
+ | DateTimePicker | The user picks one moment, a date plus a time of day, such as a scheduled send or a meeting start. | A DatePicker next to a separate TimeInput; DatePicker when the time doesn't matter; TimeInput for a time with no date. | `components/date-time-picker.md` |
94
+ | DecimalInput | The user enters money, a percentage, a measurement or another decimal that should display with fixed decimals and thousands separators. | NumberInput for counts with steppers; Slider for approximate values on a range; Input for text that isn't a number. | `components/decimal-input.md` |
95
+ | Dialog | The user must confirm or finish one short task before going back to the page, including destructive confirmations. | Sheet for long or form-heavy secondary content; Popover for a small non-blocking panel; Toast or Banner to report an outcome; never window.confirm or a custom modal. | `components/dialog.md` |
96
+ | Drawer | A side panel opens beside the main content and pushes it aside, so the user can keep working in the page while it's open. | Sheet for a modal panel that covers the page (and on small screens); NavigationDrawer for app navigation; Popover for small anchored content. | `components/drawer.md` |
97
+ | DropdownMenu | A button opens a short list of actions or view settings, such as a table row's actions menu or an account menu. | Select to pick a form value; ActionPopover for a plain icon-only list of actions; ContextMenu for right-click; Menubar for an app-wide File/Edit bar. | `components/dropdown-menu.md` |
98
+ | EmailInput | The user types an email address, with optional inline format feedback once they leave the field. | Input for any other single-line text; PasswordInput, PhoneInput or SearchInput for those field types. | `components/email-input.md` |
99
+ | Fieldset | Grouping related form fields under one title in a bordered panel, such as an address or notification preferences. | Card for content that isn't a form; CheckboxGroup or RadioGroup alone for one list of options; Separator to divide form sections without a border. | `components/fieldset.md` |
100
+ | FileInput | The user attaches one or more files from their device, such as a receipt, an avatar or a CSV to import. | a bare native file input; ImageInput or DocumentInput (same module) when only images or only documents are allowed. | `components/file-input.md` |
101
+ | Footer | A site page needs a bottom section with grouped links, legal links, a copyright line and social links. | CardFooter, DialogFooter or SheetFooter for the bottom of those surfaces; NavigationDrawerFooter for the bottom of an app sidebar; Header for the top bar. | `components/footer.md` |
102
+ | FormLabel | Naming a form control, adding helper text under it, or showing an error or status message for one field. | FieldsetLegend to title a group of fields; Banner for form-level or server errors; Toast for a saved confirmation; Typography for text that isn't part of a form. | `components/form-label.md` |
103
+ | Grid | Items go in columns, such as a grid of cards or stat tiles, a page split into main and side columns, or a layout whose column count changes with the viewport. | Table for rows users compare across the same attributes; Row with wrap for tags or chips of uneven width; Stack for a single column. | `components/grid.md` |
104
+ | Header | A site or simple app needs a top bar with a logo, a flat list of page links and actions such as search or sign-in, collapsing to a menu on small screens. | NavigationMenu for links with dropdown panels; NavigationDrawer for an app shell with a sidebar; Tabs for switching views inside a page. | `components/header.md` |
105
+ | HoverCard | A pointer user rests on a link or mention and sees a read-only preview of what it points to, such as a profile card. | Popover for anything interactive or essential; Tooltip for a short text hint; a page or Sheet for full details. | `components/hover-card.md` |
106
+ | Icon | A lucide icon (or inline svg) sits next to text, in a list row or inside a Button, and needs sizing to a --size-* token. | Button with an icon size for an icon-only action; Avatar for a person's picture; Spinner for loading; Lucide's numeric size prop or a px width. | `components/icon.md` |
107
+ | InputOTP | The user enters a short numeric one-time code from an email, text message or authenticator app. | Input for codes with letters; PasswordInput for a password or chosen PIN; NumberInput for quantities. | `components/input-otp.md` |
108
+ | Input | The user types a single line of free text: a name, title, URL, code or short answer. | Textarea for more than one line; EmailInput, PasswordInput, SearchInput, PhoneInput or NumberInput when the value has that shape; Select or RadioGroup to pick from known options. | `components/input.md` |
109
+ | Kbd | Show a keyboard key or shortcut as a keycap in help text, a tooltip, a shortcuts list or next to a trigger's label. | CommandShortcut, DropdownMenuShortcut, ContextMenuShortcut or MenubarShortcut inside those menus' rows; CodeBlock for code; plain text like Ctrl-K. | `components/kbd.md` |
110
+ | Media | You show a content image or a video and want a ratio preset, token-rounded corners, a loading state or simple playback controls. | Avatar for profile pictures; AspectRatio for embeds and custom ratios; Carousel for a slideshow; Skeleton before you have a source. | `components/media.md` |
111
+ | Menubar | An editor-style app needs a persistent desktop-style bar of menus such as File, Edit and View. | DropdownMenu for a single menu; NavigationMenu or Header for site navigation; Button or ToggleGroup for a toolbar of direct actions. | `components/menubar.md` |
112
+ | MultiSelect | The user picks several values from a list long enough to need search, such as labels, tags, assignees or filter values. | CheckboxGroup for a short list that should stay visible; Select for one value; ToggleGroup type="multiple" for toolbar states. | `components/multi-select.md` |
113
+ | NavigationDrawer | An app needs persistent side navigation between its main sections, collapsible to an icon rail on desktop and a slide-in sheet on phones. | NavigationMenu or Header for a website's top navigation; Tabs to switch views within a page; Sheet or Drawer for temporary side content. | `components/navigation-drawer.md` |
114
+ | NavigationMenu | A site header needs a row of top-level navigation links, some of which open a panel of further links. | Header for a complete site header with a mobile menu; NavigationDrawer for an app's side navigation; Tabs to switch views within a page; DropdownMenu for actions. | `components/navigation-menu.md` |
115
+ | NumberInput | The user sets a count or small number with a known step, such as a quantity, with optional minus and plus buttons. | DecimalInput for money, percentages and formatted decimals; Slider for approximate values on a range; Input for digits that aren't quantities. | `components/number-input.md` |
116
+ | Pagination | A long list or table is split into numbered pages and the user moves between them. | Tabs to switch views of the same page; Stepper for ordered steps; a "Load more" Button for feeds; Carousel for slides. | `components/pagination.md` |
117
+ | PasswordInput | The user types a password, with an optional strength meter and requirement checklist when they create one. | Input for any other single-line text; InputOTP for one-time codes; EmailInput for the username field. | `components/password-input.md` |
118
+ | PhoneInput | The user enters a phone number and you need its country calling code. | Input type="tel" when the country is fixed; Input for any other text. | `components/phone-input.md` |
119
+ | Popover | A small interactive panel (a short form, a few options) opens from a control and floats next to it without blocking the page. | DropdownMenu or ActionPopover for a list of actions; Tooltip for a text hint; HoverCard for a hover preview; Dialog or Sheet for content that must block the page. | `components/popover.md` |
120
+ | Progress | Showing how far a task with a known amount has got, such as an upload, a sync or setup completion. | Spinner when you can't say how long it will take; Skeleton for content loading into a layout; Stepper for steps in a flow. | `components/progress.md` |
121
+ | RadioGroup | The user picks exactly one option from a short list that should stay visible, such as a plan, density or delivery speed. | Select for long lists or tight space; CheckboxGroup when several options can be chosen; SegmentedControl or Tabs to switch between views. | `components/radio-group.md` |
122
+ | RichText | The user writes formatted long-form content (headings, lists, emphasis) that you store as HTML. | Textarea for plain multi-line text; Input for a single line; CodeBlock for showing code. | `components/rich-text.md` |
123
+ | Row | Items sit side by side in a line, such as a title with its actions, a group of buttons, an icon with its label, or tags that wrap. | Stack for items one above another; Grid when items must line up in columns across rows; ToggleGroup or SegmentedControl for a set of choices. | `components/row.md` |
124
+ | ScrollArea | A bounded box needs its own scrolling region with themed scrollbars, such as a long list in a fixed-height panel. | Letting the page scroll for page-length content; Accordion or Collapsible to shorten secondary content; the built-in scrolling of Command lists and Select menus. | `components/scroll-area.md` |
125
+ | SearchInput | The user types a query to search or filter, in a header, toolbar or above a list; AutocompleteSearch when they pick one result from suggestions. | Command for a command palette; Select or MultiSelect for choosing from a fixed list; Input for text that isn't a query. | `components/search-input.md` |
126
+ | SegmentedControl | The user picks exactly one of two to five short options that set the mode or filter of the current view, such as Day, Week, Month or List, Board. | Tabs when each option has its own content panel; ToggleGroup for toolbar tool options or several values; RadioGroup for a value submitted with a form; Select for longer lists. | `components/segmented-control.md` |
127
+ | Select | The user picks one value from a list too long to show as radio buttons, such as country, time zone or role. | RadioGroup for a few options that fit on screen; SegmentedControl for a mode of the same view; MultiSelect for several values; DropdownMenu for actions. | `components/select.md` |
128
+ | Separator | You need a visible line between sections, list rows or groups of inline items. | A border or spacing-token line on your own element; the separator part of DropdownMenu, ContextMenu, Menubar, Select or Command inside those; BreadcrumbSeparator in a breadcrumb. | `components/separator.md` |
129
+ | Sheet | Secondary content or a longer task (edit a record, filters, details) opens in a modal panel from the edge of the screen. | Drawer for a non-modal panel that pushes the page; Dialog for a short confirmation; Popover, HoverCard or Tooltip for small content anchored to a control. | `components/sheet.md` |
130
+ | Skeleton | Holding the shape of content that's loading into a known layout, such as a list, card grid or table on first load. | Spinner for a short in-place wait or a running action; Progress when the amount is known. | `components/skeleton.md` |
131
+ | Slider | The user sets a value or a range on a bounded scale where the position matters more than the exact number, such as volume, opacity or a price range. | NumberInput or DecimalInput when the exact value matters; SegmentedControl or RadioGroup for a few named steps; Progress to show progress. | `components/slider.md` |
132
+ | Spinner | Showing that something is working when you can't say how long it will take, such as a button action or a panel refreshing. | Progress when the amount is known; Skeleton when content loads into a known layout. | `components/spinner.md` |
133
+ | Stack | Children go one above the other with a token gap, such as page sections, form fields, or a heading over its text. | Row for items side by side; Grid for columns; Fieldset for a labelled group of form fields; margins on the children. | `components/stack.md` |
134
+ | Stepper | Showing where the user is in a fixed sequence of steps, such as a checkout or an onboarding wizard. | Tabs for switching between independent views; Progress for a percentage; Breadcrumb for where a page sits in the site. | `components/stepper.md` |
135
+ | Switch | Turning a setting on or off where the change takes effect immediately, such as notifications or a feature flag. | Checkbox for choices the user submits with a form; Toggle for a pressed toolbar button; RadioGroup or SegmentedControl for more than two options. | `components/switch.md` |
136
+ | Table | Showing items the user compares across the same attributes, such as users, invoices or plan features. | Card for items browsed on their own; TreeView for hierarchical data; your own grid of divs for tabular data. | `components/table.md` |
137
+ | Tabs | One area of a page switches between a few peer views of the same subject, such as Overview, Activity and Settings for one project. | SegmentedControl to switch a value or filter without separate panels; NavigationMenu, NavigationDrawer or links to go to another page; Accordion to stack sections the user can open together. | `components/tabs.md` |
138
+ | Textarea | The user writes free text that can run past one line: a message, description, note or comment. | Input for single-line values; RichText when the text needs formatting such as bold, lists or links. | `components/textarea.md` |
139
+ | TimeInput | The user enters a time of day with no date, such as opening hours or a daily reminder. | Input type=time or a Select of times; DateTimePicker when a date is needed too. | `components/time-input.md` |
140
+ | Toast | Briefly confirming an action that just finished, such as "Settings saved"; mount Toast once, then call toast() from sonner. | Banner for persistent, blocking or form-level messages; FormMessage for a single field; Dialog when the user must decide. | `components/toast.md` |
141
+ | ToggleGroup | A row of related pressable tool options in a toolbar, pressing one (text alignment) or several (bold, italic, underline). | SegmentedControl for a mode or filter of the same view; RadioGroup or CheckboxGroup for a form value; Toggle for a single on/off; Tabs to switch panels. | `components/toggle-group.md` |
142
+ | Toggle | A single button that stays pressed to show a state of the content or view, such as Bold, Mute or Show grid. | Switch for an on/off setting; Button for a one-off action; ToggleGroup for a set of related toggles; Checkbox for a yes/no submitted with a form. | `components/toggle.md` |
143
+ | Tooltip | A short text hint appears when the user hovers or focuses a control, such as the label and shortcut of an icon-only button. | aria-label for naming a control (a tooltip only describes); Popover or HoverCard for rich or interactive content; inline helper text or FormMessage for anything essential. | `components/tooltip.md` |
144
+ | TreeView | Showing hierarchical data the user expands and picks from, such as a file explorer, a folder picker or a category tree. | Accordion for stacked content sections; NavigationDrawer for app navigation; nested lists you build yourself. | `components/tree-view.md` |
145
+ | Typography | Setting any app text (page titles, section headings, paragraphs, labels and captions) on the fluid type scale. | Raw h1–h6, p or span with hand-set font sizes; Label for form labels; CodeBlock or Kbd for code. | `components/typography.md` |
146
+ | VisuallyHidden | Text should reach screen readers but not show, such as a heading sighted users infer from the layout, extra context on a link, or a status announced with a live region. | aria-label on the control itself for an icon-only Button; Tooltip when sighted users need the text too; display none or the hidden attribute, which hide it from everyone. | `components/visually-hidden.md` |
147
+ <!-- index:end -->
148
+
149
+ ## Foundations
150
+
151
+ | File | Read before |
152
+ | --- | --- |
153
+ | `foundations/theming.md` | applying or switching a theme, dark mode, density, corner style |
154
+ | `foundations/colour.md` | choosing any colour |
155
+ | `foundations/typography.md` | setting any text style |
156
+ | `foundations/spacing.md` | any margin, padding, gap or fixed size |
157
+ | `foundations/radius.md` | any corner |
158
+ | `foundations/elevation.md` | any shadow or layering (no tokens yet) |
159
+ | `foundations/motion.md` | any transition or animation (no tokens yet) |
160
+ | `foundations/iconography.md` | adding an icon |
161
+
162
+ ## When nothing fits
163
+
164
+ Compose from existing components and tokens. Add a code comment `// eluan: composed, no component for {intent}`. Never introduce a new colour, radius, shadow or font.
165
+
166
+ Known gaps: Eluan has no Alert (use Banner with `position="inline"`), no EmptyState (see `patterns/empty-states.md`), no Link (use Button `variant="link"` with `asChild`, or your router's link), no IconButton (use Button with an `icon*` size) and no List component.
@@ -0,0 +1,212 @@
1
+ ---
2
+ name: Accordion
3
+ use_when: Stacking several sections of secondary content the user may skip, each expanded from its own header, such as an FAQ or advanced settings.
4
+ instead_of: Collapsible for a single show/hide region; Tabs for switching between peer views; Card or headings for content everyone needs.
5
+ source: packages/core/src/components/accordion.tsx
6
+ ---
7
+
8
+ # Accordion
9
+
10
+ ## 1. Overview
11
+
12
+ Accordion is a vertical stack of sections, each with a header button that shows or hides its content. It wraps Radix Accordion: the root sets whether one or several sections can be open, and each item has a trigger and a content region.
13
+
14
+ ## 2. When to use
15
+
16
+ - FAQs and help content on a page.
17
+ - Advanced or rarely changed settings below the main ones.
18
+ - Long secondary detail (release notes, policy sections) that most users skip.
19
+ - Grouped filters in a side panel, where several groups may be open at once (`type="multiple"`).
20
+
21
+ ### When not to use
22
+
23
+ - One region to show or hide → use [Collapsible](./collapsible.md).
24
+ - Switching between peer views of the same thing → use [Tabs](./tabs.md).
25
+ - Content every user needs to read or act on → show it with headings ([Typography](./typography.md)) or in a [Card](./card.md).
26
+ - Steps the user completes in order → use [Stepper](./stepper.md).
27
+ - Nested folders or hierarchical data → use [TreeView](./tree-view.md).
28
+
29
+ ## 3. Anatomy
30
+
31
+ 1. **Accordion**: the root. Sets `type` (single or multiple) and holds the open state.
32
+ 2. **AccordionItem**: one section, with a required `value` and a bottom border in `--interactive-border-alt`.
33
+ 3. **AccordionTrigger**: the header. Renders a `<button>` inside an `<h3>`, with the label at `--font-size-base`, weight 500, and a chevron at the end that turns over when open.
34
+ 4. **AccordionContent**: the region below the trigger, in muted `--font-size-sm` text, padded top and bottom.
35
+
36
+ ## 4. Variants
37
+
38
+ Accordion has no visual variants. `type` sets the behaviour:
39
+
40
+ | Type | Use for |
41
+ | --- | --- |
42
+ | `single` | FAQs and settings, where opening one section closes the other. Add `collapsible` so the open section can be closed again. |
43
+ | `multiple` | Filters or reference sections the user wants to compare side by side. |
44
+
45
+ ## 5. Sizes
46
+
47
+ Accordion has no size prop. Text uses `--font-size-base` (trigger) and `--font-size-sm` (content), which follow density.
48
+
49
+ ## 6. States
50
+
51
+ | State | Looks like | Notes |
52
+ | --- | --- | --- |
53
+ | Closed | Trigger label and chevron pointing down; content hidden | `data-state="closed"` on the trigger. |
54
+ | Open | Chevron turned up; content shown | `data-state="open"`. |
55
+ | Hover | No visible change | The hover rule sets the same colour as rest. |
56
+ | Focus | The browser's default focus ring | AccordionTrigger declares no focus style. Never remove or restyle the focus ring. |
57
+ | Disabled | No visible change | `disabled` on Accordion or an item blocks toggling but isn't styled. Remove a section rather than disabling it. |
58
+
59
+ ## 7. Content guidelines
60
+
61
+ - Write trigger labels as the question or topic the section answers: "Can I change plans later?", "Data retention".
62
+ - Keep labels to one line. Use sentence case.
63
+ - Open with the answer in the first sentence of the content.
64
+ - Keep each section self-contained; don't refer to "the section above".
65
+
66
+ | Do | Don't |
67
+ | --- | --- |
68
+ | Can I change plans later? | Plans |
69
+ | Data retention | Click to see more |
70
+ | Yes. Switch plans from Billing at any time. | As mentioned above, you can… |
71
+
72
+ ## 8. Rules
73
+
74
+ 1. Set `type` on every Accordion; it's required. With `type="single"`, add `collapsible` unless one section must always stay open.
75
+ 2. Give each AccordionItem a unique, stable `value`.
76
+ 3. Pass only text (and inline content) to AccordionTrigger. It already renders the chevron; don't add another icon or a Button inside it.
77
+ 4. Don't hide content users need to complete the task inside a closed section.
78
+ 5. Don't nest an Accordion inside an AccordionContent.
79
+ 6. Don't pass `className` or `style`, even to the Accordion root. The root is Radix's own and doesn't drop them, but every other part does; set width on a wrapper.
80
+
81
+ ## 9. Dos and don'ts
82
+
83
+ **Do:** let the user close the open section.
84
+
85
+ ```tsx
86
+ <Accordion type="single" collapsible>
87
+ <AccordionItem value="plans">
88
+ <AccordionTrigger>Can I change plans later?</AccordionTrigger>
89
+ <AccordionContent>Yes. Switch plans from Billing at any time.</AccordionContent>
90
+ </AccordionItem>
91
+ </Accordion>
92
+ ```
93
+
94
+ **Don't:** use a single-item Accordion for one show/hide region.
95
+
96
+ ```tsx
97
+ <Accordion type="single">
98
+ <AccordionItem value="more">
99
+ <AccordionTrigger>Show more</AccordionTrigger>
100
+ <AccordionContent>Extra details</AccordionContent>
101
+ </AccordionItem>
102
+ </Accordion>
103
+ ```
104
+
105
+ **Do:** keep the trigger to a label.
106
+
107
+ ```tsx
108
+ <AccordionTrigger>Data retention</AccordionTrigger>
109
+ ```
110
+
111
+ **Don't:** add icons or controls to the trigger.
112
+
113
+ ```tsx
114
+ <AccordionTrigger>
115
+ <ChevronDown /> Data retention <Button size="iconSm">Edit</Button>
116
+ </AccordionTrigger>
117
+ ```
118
+
119
+ ## 10. Accessibility
120
+
121
+ - Role: each AccordionTrigger is a `button` inside an `h3`, with `aria-expanded` and `aria-controls`. AccordionContent is a `region` labelled by its trigger.
122
+ - Heading level: always `h3`. AccordionTrigger doesn't expose the header part, so place the Accordion where an `h3` fits the outline, for example under an `h2` section heading.
123
+ - Label: the trigger's text content. The chevron is `aria-hidden`.
124
+ - Keyboard: Enter and Space toggle the focused section. Tab and Shift+Tab move between triggers and into open content. Arrow Down and Arrow Up move focus between triggers; Home and End jump to the first and last.
125
+ - Focus: stays on the trigger when a section opens or closes. The trigger shows the browser's default ring; don't add your own.
126
+ - Contrast: handled by the theme. Don't override colours.
127
+
128
+ ## 11. Behaviour
129
+
130
+ - Responsive: Accordion fills its parent's width. Constrain it with a wrapper.
131
+ - Overflow and truncation: trigger labels and content wrap; nothing truncates.
132
+ - Motion: the chevron turns over 200ms. Content opens and closes without a height animation. Don't add your own.
133
+ - Controlled or not: pass `defaultValue` to open sections on first render, or `value` with `onValueChange` to control them. `value` is a string for `single` and a string array for `multiple`.
134
+
135
+ ## 12. API
136
+
137
+ <!-- api:start -->
138
+ ### Accordion
139
+
140
+ | Prop | Type | Default | Description |
141
+ | --- | --- | --- | --- |
142
+ | `type` | `"single" \| "multiple"` | | Required. One open section at a time, or several. |
143
+ | `collapsible` | `boolean` | `false` | `single` only. Lets the open section close again. |
144
+ | `defaultValue` | `string \| string[]` | | Sections open on first render (uncontrolled). Array for `multiple`. |
145
+ | `value` | `string \| string[]` | | Open sections (controlled). |
146
+ | `onValueChange` | `(value: string \| string[]) => void` | | Called when sections open or close. |
147
+ | `disabled` | `boolean` | `false` | Disables every section. Not styled. |
148
+ | `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Which arrow keys move between triggers. |
149
+ | `...props` | Radix `Accordion.Root` props | | `dir`, `aria-*`. Don't pass `className` or `style`. |
150
+
151
+ ### AccordionItem
152
+
153
+ | Prop | Type | Default | Description |
154
+ | --- | --- | --- | --- |
155
+ | `value` | `string` | | Required. Unique id for the section. |
156
+ | `disabled` | `boolean` | `false` | Blocks toggling this section. Not styled. |
157
+ | `...props` | Radix `Accordion.Item` props without `className`, `style` | | |
158
+
159
+ ### AccordionTrigger
160
+
161
+ | Prop | Type | Default | Description |
162
+ | --- | --- | --- | --- |
163
+ | `children` | `ReactNode` | | The section label. The chevron is added for you. |
164
+ | `...props` | Radix `Accordion.Trigger` props without `className`, `style` | | Native button attributes. |
165
+
166
+ ### AccordionContent
167
+
168
+ | Prop | Type | Default | Description |
169
+ | --- | --- | --- | --- |
170
+ | `children` | `ReactNode` | | The section body. |
171
+ | `forceMount` | `true` | | Keeps the content in the DOM while closed. |
172
+ | `...props` | Radix `Accordion.Content` props without `className`, `style` | | |
173
+ <!-- api:end -->
174
+
175
+ ## 13. Examples
176
+
177
+ ```tsx
178
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Typography } from "@eluan/core";
179
+
180
+ const faqs = [
181
+ { id: "change-plan", question: "Can I change plans later?", answer: "Yes. Switch plans from Billing at any time. We prorate the difference on your next invoice." },
182
+ { id: "cancel", question: "What happens to my data if I cancel?", answer: "Your projects stay read-only for 30 days, then we delete them. Export them from Settings before you cancel." },
183
+ { id: "invoices", question: "Where do I find past invoices?", answer: "Go to Billing, then Invoices. Each invoice downloads as a PDF." },
184
+ ];
185
+
186
+ export function BillingFaq() {
187
+ return (
188
+ <section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
189
+ <Typography variant="heading" as="h2">Billing questions</Typography>
190
+ <Accordion type="single" collapsible defaultValue="change-plan">
191
+ {faqs.map((faq) => (
192
+ <AccordionItem key={faq.id} value={faq.id}>
193
+ <AccordionTrigger>{faq.question}</AccordionTrigger>
194
+ <AccordionContent>{faq.answer}</AccordionContent>
195
+ </AccordionItem>
196
+ ))}
197
+ </Accordion>
198
+ </section>
199
+ );
200
+ }
201
+ ```
202
+
203
+ ## 14. Related components
204
+
205
+ - [Collapsible](./collapsible.md): a single show/hide region.
206
+ - [Tabs](./tabs.md): switch between peer views instead of stacking them.
207
+ - [TreeView](./tree-view.md): expandable hierarchical data.
208
+ - [Typography](./typography.md): the `h2` section heading above an Accordion.
209
+
210
+ ## 15. Common agent mistakes
211
+
212
+ _Filled from evals._