cferdinandi / cferdinandi/kelp

Component: Scrollspy

Open
#136 1 comment 0 reactions 0 assignees View on GitHub
enhancement roadmap
Dominant language
JavaScript
Stars
645
Forks
19
PR merge metrics
No merged PRs in 30d

Description

**Original title:** Highlight TOC title for current heading in viewport

**Is your feature request related to a problem? Please describe.**
It would be nice if the table-of-contents component could highlight the title of the current heading in viewport.

**Describe the solution you'd like**
As suggested by @cferdinandi a separated component `scrollspy` could be implemented. The component could interact with the TOC maybe through events (?).

**Describe alternatives you've considered**
Time ago I developed a [component](https://git.andreafazzi.eu/andrea/tableofcontents) like this but I think we can produce a more robust alternative.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing table-of-contents component and reviewing the linked reference implementation. Clarify how a separate scrollspy component should interact with the TOC, including whether events are needed. Done means the title for the heading currently in the viewport is highlighted.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.