use-toc

0.1.0 • Public • Published

useToc

Create easy to use data for building table of content for you react component.

Installation

npm i use-toc

or

yarn add use-toc

Usage Example

import Toc from ".components/Toc";
import useToc from 'use-toc';

export default function App() {
  const toc = usesToc(".container h3");

  return (
    <div className="App">
      <Toc tocData={toc} />
      // ...
  )
}

Demo

Sand Box


Package Sidebar

Install

npm i use-toc

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

2.48 kB

Total Files

4

Last publish

Collaborators

  • or-yam