@types/react-scrollspy
TypeScript icon, indicating that this package has built-in type declarations

3.3.9 • Public • Published

Installation

npm install --save @types/react-scrollspy

Summary

This package contains type definitions for react-scrollspy (https://github.com/makotot/react-scrollspy).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-scrollspy.

index.d.ts

import * as React from "react";

export interface ScrollspyProps {
    children?: React.ReactNode;

    // Array of target element IDs
    items: readonly string[];

    // Class name that apply to the navigation element paired with the content element in viewport
    currentClassName: string;

    // Class name that apply to the navigation elements that have been scrolled past
    scrolledPastClassName?: string | undefined;

    // HTML tag for Scrollspy component if you want to use other than ul
    componentTag?: string | React.ComponentType | undefined;

    // Style attribute to be passed to the generated <ul /> element
    style?: React.CSSProperties | undefined;

    // Offset value that adjusts to determine the elements are in the viewport
    offset?: number | undefined;

    // Selector for the element of scrollable container that can be used with querySelector
    rootEl?: string | undefined;

    // Function to be executed when the active item has been updated
    onUpdate?: ((item: HTMLElement) => void) | undefined;

    // ClassName attribute to be passed to the generated <ul /> element
    className?: string | undefined;
}

export default class Scrollspy extends React.Component<ScrollspyProps> {
    // Add event listener of scrollspy.
    onEvent(): void;

    // Remove event listener of scrollspy.
    offEvent(): void;
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Zhang Yi Jiang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-scrollspy

Weekly Downloads

12,550

Version

3.3.9

License

MIT

Unpacked Size

5.4 kB

Total Files

5

Last publish

Collaborators

  • types