A dynamic Table of Contents, crafted in React's grace, with scrolling magic and animations fair. It tracks thy progress, marks each chosen place; perfect for pages long—thy reader's guide with flair!
All
The DynamicToc component manages a table-of-contents (TOC) with interactive and animated behavior:
State Management:
Animation & Layout:
UI Elements:
Scroll Integration:
Prop | Type | Default | Description |
---|---|---|---|
value | TOC_INTERFACE | none | The currently selected TOC item. |
setValue | (v: TOC_INTERFACE) => void | none | Callback to update the selected TOC item. |
data | TOC_INTERFACE[] | none | Array of TOC items used to render the list of selectable items. |
ref | any | none | Reference to the container used for tracking scroll progress. |
transition | Transition | { type: "spring", duration: 0.5, bounce: 0.1 } | Configuration for the animation transitions. |
className | string | none | Additional CSS classes for custom styling of the component. |
TOC_INTERFACE (exported)
Prop | Type | Default | Description |
---|---|---|---|
name | string | none | Title or label of the TOC item. |
value | string | none | Optional value associated with the TOC item. |