0.3.0 • Published 1 month ago
@evanoc3/elements v0.3.0
@evanoc3/elements
This repository contains the source code of an NPM package containing a collection of custom web components.
See below for a list of components available:
Table of Contents
Located insrc/toc.ts
. This element takes a query selector string for itssrc
attribute. It then uses this to scan the specified element for all of the headers (h1, h2, etc...) within it and stores information about them. It then renders this data structure as a nested list.This element can be either dynamic or static depending on the presence/absence of the `dynamic="dynamic"` attribute. In dynamic mode, the element monitors the user's current scroll position along the content of the target element, and will automatically expand nested lists, and highlight the active header within the list. In contrast, in static mode, all of the nested lists are expanded and the current header is not highlighted.