How ahmed-al-hatem/accordion-component works
This repository packages a copy-and-edit React accordion and a browser-based playground/docs site. Users can configure a live accordion, inspect its generated JSX, and share settings in the URL; the docs explain installation, composition, accessibility, theming, deep links, lazy mounting, print behavior, and FAQ structured data. The reusable component is the product runtime, while the site demonstrates and documents it. Unsampled modules are included where the README or SOURCE INDEX establishes their role; arrows are limited to shown imports and calls.
Main entry points: Playground.jsx Playground page · App.jsx App router shell · Docs.jsx Docs page · CodeBlock.jsx Code display and copy
Components 19
Accordion component
- Accordion runtime
src/components/accordion/Accordion.jsx - Accordion styles
src/components/accordion/accordion.css
Live playground
- Playground page
src/pages/Playground.jsx - Configuration controls
src/components/Sidebar.jsx - Settings and URL codec
src/data/playgroundOptions.js - Demo FAQ content
src/data/faq.js - Generated JSX view
src/components/CodeBox.jsx
Documentation
- Code display and copy
src/components/CodeBlock.jsx - Syntax highlighting
src/lib/highlight.jsx - Docs page
src/pages/Docs.jsx - API reference data
src/data/accordionApi.js
Application shell
- React entry
src/main.jsx - App router shell
src/App.jsx - Hash routing
src/lib/useHashRoute.js - Theme preference
src/lib/useTheme.js - Navigation bar
src/components/Navbar.jsx - Site icons
src/components/Icons.jsx
Other components
- Site visitor
- Browser local storage
Connections 23
- Site visitor → React entry: opens site
README.md - React entry → App router shell: mounts
src/main.jsx - App router shell → Hash routing: reads route
src/App.jsx - App router shell → Theme preference: loads theme
src/App.jsx - App router shell → Navigation bar: renders
src/App.jsx - App router shell → Playground page: renders
src/App.jsx - App router shell → Docs page: renders
src/App.jsx - Navigation bar → Site icons: renders
src/components/Navbar.jsx - Theme preference → Browser local storage: reads and writes
src/lib/useTheme.js - Playground page → Configuration controls: renders controls
src/pages/Playground.jsx - Playground page → Generated JSX view: renders code
src/pages/Playground.jsx - Playground page → Accordion runtime: renders preview
src/pages/Playground.jsx - Playground page → Demo FAQ content: loads demo items
src/pages/Playground.jsx - Playground page → Settings and URL codec: parses and serializes
src/pages/Playground.jsx - Configuration controls → Settings and URL codec: uses settings
src/components/Sidebar.jsx - Generated JSX view → Code display and copy: renders code
src/components/CodeBox.jsx - Code display and copy → Syntax highlighting: highlights code
src/components/CodeBlock.jsx - Code display and copy → Site icons: renders copy icons
src/components/CodeBlock.jsx - Docs page → Code display and copy: renders examples
src/pages/Docs.jsx - Docs page → Site icons: renders example icon
src/pages/Docs.jsx - Docs page → API reference data: renders API reference
src/pages/Docs.jsx - Docs page → Accordion runtime: renders demos
src/pages/Docs.jsx - Accordion runtime → Accordion styles: imports styles
src/components/accordion/Accordion.jsx