{"id":30472480,"url":"https://github.com/sebmeister2077/editorjs-accordion","last_synced_at":"2026-01-27T12:35:23.456Z","repository":{"id":309105216,"uuid":"1034723278","full_name":"sebmeister2077/editorjs-accordion","owner":"sebmeister2077","description":"Editorjs block tool that allows selecting blocks for accordion behaviour","archived":false,"fork":false,"pushed_at":"2025-09-06T08:21:19.000Z","size":4028,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T10:12:48.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/editorjs-collapsible-block","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebmeister2077.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-08T21:49:04.000Z","updated_at":"2025-09-06T08:18:40.000Z","dependencies_parsed_at":"2025-08-09T22:16:32.490Z","dependency_job_id":"933e5f6e-25e2-46ec-af31-ae5c01358b1b","html_url":"https://github.com/sebmeister2077/editorjs-accordion","commit_stats":null,"previous_names":["sebmeister2077/editorjs-accordion"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sebmeister2077/editorjs-accordion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebmeister2077%2Feditorjs-accordion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebmeister2077%2Feditorjs-accordion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebmeister2077%2Feditorjs-accordion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebmeister2077%2Feditorjs-accordion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebmeister2077","download_url":"https://codeload.github.com/sebmeister2077/editorjs-accordion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebmeister2077%2Feditorjs-accordion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-24T09:02:24.115Z","updated_at":"2026-01-27T12:35:23.450Z","avatar_url":"https://github.com/sebmeister2077.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":["Block Tools"],"readme":"# Editor.js Accordion Block\n\nA customizable **Accordion block tool** for [Editor.js](https://editorjs.io/) that lets you group and toggle visibility of multiple blocks (headings, paragraphs, tables, images, etc.) under a collapsible title. All styles are customizable\n\n![example](./assets/example1.gif)\n\n\n---\n\n## Features\n\n- Group any number of Editor.js blocks under an expandable/collapsible section.\n- Works in both **edit** and **read-only** modes.\n- Configurable default expanded state and block count.\n- Fully styleable via **CSS overrides**.\n- Optional animations.\n- Max block count enforcement.\n\n---\n\n## Installation\n\n```bash\nnpm install editorjs-collapsible-block\n```\n\nor via CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/editorjs-collapsible-block\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### 1. Register in Editor.js\n\n```js\nimport EditorJS from '@editorjs/editorjs';\nimport Accordion from 'editorjs-collapsible-block';\n\nconst editor = new EditorJS({\n  holder: 'editor',\n  tools: {\n    accordion: {\n      class: Accordion,\n      // optional config\n      config: {\n        defaultExpanded: true,\n        maxBlockCount: 10,\n        disableAnimation: false,\n        overrides: {\n          styles: {\n            blockWrapper: 'background-color: lightyellow;',\n            blockContent: 'border-left: 2px solid #ccc;',\n            lastBlockContent: 'border-bottom: 2px solid #ccc;',\n            insideContent: 'padding: 10px;',\n          },\n        },\n      },\n    },\n  },\n});\n```\n\n### 2. Using in the Editor\n\n- Title: Editable inline text for the accordion heading.\n\n- Block count: Number of following blocks to include in the accordion group.\n\n- Default expanded: Whether the accordion starts open in read mode.\n\n- Controlled blocks can be any Editor.js block type (header, paragraph, table, list, image, etc.).\n\n### 3. Saving Data\n\n`save()` returns:\n\n```json\n{\n  \"type\": \"accordion\",\n  \"data\": {\n    \"settings\": {\n      \"blockCount\": 3,\n      \"defaultExpanded\": true\n    },\n    \"title\": \"My Accordion\"\n  }\n}\n```\n\n### Configuration Options\n\n| Option                                  | Type          | Description                                                                   | Default     |\n| --------------------------------------- | ------------- | ----------------------------------------------------------------------------- | ----------- |\n| `defaultExpanded`                       | `boolean`     | Whether accordion is expanded in read mode by default.                        | `true`      |\n| `overrides.classes.wrapper`             | `string`      | Extra CSS classes for the accordion wrapper.                                  | `\"\"`        |\n| `overrides.classes.settings`            | `string`      | Extra classes for settings button container.                                  | `\"\"`        |\n| `overrides.classes.title`            | `string`      | Extra classes for the titlec.                                  | `\"\"`        |\n| `overrides.classes.settingsPopover`     | `string`      | Extra classes for settings popover container.                                 | `\"\"`        |\n| `overrides.classes.settingsContent`     | `string`      | Extra classes for popover content.                                            | `\"\"`        |\n| `overrides.classes.settingsBlockConfig` | `string`      | Extra classes for popover block config wrapper.                               | `\"\"`        |\n| `overrides.classes.settingsCheckbox`    | `string`      | Extra classes for settings checkbox input.                                    | `\"\"`        |\n| `overrides.classes.settingsDelimiter`   | `string`      | Extra classes for popover delimiter element.                                  | `\"\"`        |\n| `overrides.styles.blockWrapper`         | `string`      | CSS rules applied to `.ce-block[data-readonly] .accordion-wrapper`.           | `undefined` |\n| `overrides.styles.blockContent`         | `string`      | CSS rules applied to `.ce-block__content` when editor is read-only.           | `undefined` |\n| `overrides.styles.lastBlockContent`     | `string`      | CSS rules applied to the last block’s content.                                | `undefined` |\n| `overrides.styles.insideContent`        | `string`      | CSS rules applied to the content inside the block (`.ce-block__content \u003e *`). | `undefined` |\n| `overrides.settingsIcon`                | `HTMLElement` | Custom element for settings icon.                                             | `undefined` |\n| `disableAnimation`                      | `boolean`     | Disables expand/collapse animations.                                          | `false`     |\n| `maxBlockCount`                         | `number`      | Maximum allowed block count in accordion.                                     | `10`        |\n\n### FAQ\n\n#### Why am I using style overrides written only as CSS strings\n\nBecause I rely on plain CSS to style only the necessary blocks, without directly manipulating the DOM. This approach helps minimize unexpected bugs.\nIn the future, I plan to add an option to use JavaScript for styling, as it would offer better performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebmeister2077%2Feditorjs-accordion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebmeister2077%2Feditorjs-accordion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebmeister2077%2Feditorjs-accordion/lists"}