{"id":20279077,"url":"https://github.com/t-vk/dynamicquilltools","last_synced_at":"2026-02-28T11:09:00.147Z","repository":{"id":38473395,"uuid":"222782962","full_name":"T-vK/DynamicQuillTools","owner":"T-vK","description":"DynamicQuillTools is a library that allows you to dynamically add or remove new custom elements to/from a Quill Editor's toolbar. For instance a button or a drop down menu.","archived":false,"fork":false,"pushed_at":"2020-03-06T00:39:54.000Z","size":560,"stargazers_count":51,"open_issues_count":7,"forks_count":18,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T06:24:48.922Z","etag":null,"topics":["button","custom","dropdown","dynamic","quill","quill-editor","quilljs","toolbar"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/T-vK.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}},"created_at":"2019-11-19T20:25:08.000Z","updated_at":"2024-12-19T14:34:00.000Z","dependencies_parsed_at":"2022-08-09T04:18:36.171Z","dependency_job_id":null,"html_url":"https://github.com/T-vK/DynamicQuillTools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/T-vK/DynamicQuillTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FDynamicQuillTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FDynamicQuillTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FDynamicQuillTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FDynamicQuillTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-vK","download_url":"https://codeload.github.com/T-vK/DynamicQuillTools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FDynamicQuillTools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266673581,"owners_count":23966376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["button","custom","dropdown","dynamic","quill","quill-editor","quilljs","toolbar"],"created_at":"2024-11-14T13:28:02.144Z","updated_at":"2026-02-28T11:08:55.105Z","avatar_url":"https://github.com/T-vK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DynamicQuillTools\n\nDynamicQuillTools is a library that allows you to dynamically add or remove new custom elements to/from a Quill Editor's toolbar. For instance a button or a drop down menu.\n\n## Screenshot\n\nIn this screenshot you can see a custom drop down menu and a custom button.\n\n![screenshot](./screenshot.png)\n\n## Live Demo\nhttps://t-vk.github.io/DynamicQuillTools/example.html\n\n## CDN\nIf you prefer CDNs you can include the library on your website like this:\n``` HTML\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/T-vK/DynamicQuillTools@master/DynamicQuillTools.js\"\u003e\u003c/script\u003e\n```\n\n## Examples\nFor a full example take a look at [example.html](./example.html).\n\n### Very Basic Example\n\n``` JavaScript\nconst myButton = new QuillToolbarButton({\n    icon: `\u003csvg viewBox=\"0 0 18 18\"\u003e \u003cpath class=\"ql-stroke\" d=\"M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3\"\u003e\u003c/path\u003e\u003c/svg\u003e`\n})\nmyButton.onClick = function(quill) {\n    alert('You just clicked the button!')\n}\nmyButton.attach(quill) // Add the custom button to the quill editor\n```\n\n### Adding a Custom Button\n\n``` JavaScript\nconst myButton = new QuillToolbarButton({\n    icon: `\u003csvg viewBox=\"0 0 18 18\"\u003e \u003cpath class=\"ql-stroke\" d=\"M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3\"\u003e\u003c/path\u003e\u003c/svg\u003e`\n})\nmyButton.onClick = function(quill) {\n    // Do whatever you want here. You could use this.getValue() or this.setValue() if you wanted.\n\n    // For example, get the selected text and convert it to uppercase:\n    const { index, length } = quill.selection.savedRange\n    const selectedText = quill.getText(index, length)\n    const newText = selectedText.toUpperCase()\n    quill.deleteText(index, length)\n    quill.insertText(index, newText)\n    quill.setSelection(index, newText.length)\n}\nmyButton.attach(quill)\n```\n\n### Adding a Custom Drop Down Menu\n\n``` JavaScript\nconst dropDownItems = {\n    'Mike Smith': 'mike.smith@gmail.com',\n    'Jonathan Dyke': 'jonathan.dyke@yahoo.com',\n    'Max Anderson': 'max.anderson@gmail.com'\n}\n\nconst myDropDown = new QuillToolbarDropDown({\n    label: \"Email Addresses\",\n    rememberSelection: false\n})\n\nmyDropDown.setItems(dropDownItems)\n\nmyDropDown.onSelect = function(label, value, quill) {\n    // Do whatever you want with the new dropdown selection here\n\n    // For example, insert the value of the dropdown selection:\n    const { index, length } = quill.selection.savedRange\n    quill.deleteText(index, length)\n    quill.insertText(index, value)\n    quill.setSelection(index + value.length)\n}\n\nmyDropDown.attach(quill)\n```\n\n\n## API Documentation\nhttps://t-vk.github.io/DynamicQuillTools/docs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-vk%2Fdynamicquilltools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-vk%2Fdynamicquilltools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-vk%2Fdynamicquilltools/lists"}