1.0.7 • Published 2 years ago

slick-toc v1.0.7

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Slick TOC

Easily generate dynamic tables of contents!

Usage

Basic

import { useSlickToc } from "@killeencode/slick-toc";

const App = () => {
  const [register, TableOfContents] = useSlickToc();

  return (
    <main>
      <h2>Table of Contents</h2>
      <TableOfContents />
      <section {...register("About")}>
        <h2>About</h2>
      </section>
      <section {...register("Contact")}>
        <h2>Contact</h2>
      </section>
    </main>
  );
};

Customize Components

const App = () => {
    const [register, TableOfContents] = useSlickToc({
        ListContainer: MyCustomContainer
        ListItem: MyCustomItem
    });

    return (

        <main>
            <h2>Table of Contents</h2>
            <TableOfContents />
            <section {...register('About')}>
                <h2>About</h2>
            </section>
            <section {...register('Contact')}>
                <h2>Contact</h2>
            </section>
        </main>
    )
}

Todo

  • Add Context

Development

  • npm i -g pnpm
  • pnpm i
  • pnpm dev

Changesets

Generate changesets with pnpm changeset

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago