flexext / craft-article-reader-ux
Automatic Table of Contents (H2-H4 anchor injector), Reading Time Estimator, Sticky Scroll Reading Progress Bar, and Article Schema.org JSON-LD for Craft CMS 4 & 5.
Package info
github.com/flexext-dev/craft-article-reader-ux
Type:craft-plugin
pkg:composer/flexext/craft-article-reader-ux
1.0.2
2026-12-01 16:00 UTC
Requires
- php: ^8.1
- craftcms/cms: ^4.5.0 || ^5.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Automatic H2-H4 Table of Contents with unique anchor IDs, accurate multi-language Reading Time calculator, Sticky Scroll Reading Progress Bar, 1-click Copy Heading Links, and Schema.org Article JSON-LD for Craft CMS 4.5+ & 5.x — zero jQuery, WCAG 2.2 AA Light & Dark mode contrast verified.
Included Features (Single Standard Edition)
- Twig Filters & Variable:
{{ entry.body | injectToc }},{{ entry.body | readingTime }},{{ craft.articleUx.toc(entry.body) }}, and{{ craft.articleUx.readingTime(entry.body) }}. - UTF-8 Safe
DOMDocumentAnchor Injector: Automatically adds unique slugifiedid="..."anchors to H2–H4 headings with deduplication for repeated titles. - Sticky Scroll Reading Progress Bar:
{{ craft.articleUx.progressBar() }}— passive scroll listener, zero CLS, respectsprefers-reduced-motion. - 1-Click Copy Heading Links & Article Schema: Clickable
#anchor links +{{ craft.articleUx.articleSchema(entry, entry.body) }}outputtingSchema.org ArticleJSON-LD withwordCount& ISO 8601timeRequired.
Installation
composer require flexext/craft-article-reader-ux php craft plugin/install article-reader-ux
Requirements
- Craft CMS 4.5+ or 5.0+
- PHP 8.1 - 8.4 (with
ext-dom/ext-libxml)