Creative Slice - Table of Contents Block self-updates
Block showing table of contents with dynamic links to headings on the page
by Creative Slice · github.com/creativeslice/cslice-table-of-contents · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/creativeslice/cslice-table-of-contents/archive/refs/heads/main.zipShips its own WordPress updater (built-in updater), so new versions show up under Dashboard → Updates.
Table of Contents Block
A WordPress block plugin by Creative Slice that adds a dynamic table of contents block, automatically generating navigation from page headings.
Features
- Automatically generates navigation from page headings
- Tracks scroll position and highlights active section
- Two display styles:
- Default vertical list
- Horizontal scrolling navigation
- Full block editor customization:
- Typography settings with font size and weight controls
- Background color with opacity support
- Border controls (color, width, style, radius)
- Box shadow
- Spacing (margin and padding)
- Wide and full width alignment
- Blur effect for semi-transparent backgrounds if white background is used
- No JavaScript overhead on pages without TOC
- Clean, efficient vanilla JS scroll tracking
Requirements
- WordPress 6.7 or later
- PHP 8.0 or later
- Node.js 20+ for development
Development
-
Install dependencies:
npm install -
Start development server:
npm start -
Build for production:
npm run build -
Create plugin zip:
npm run plugin-zip