janosh / svelte-toc

Sticky responsive table of contents component
https://janosh.github.io/svelte-toc
MIT License
113 stars 6 forks source link

Breaking: hide ToC if empty #30

Closed janosh closed 1 year ago

janosh commented 1 year ago

If no headings match selector, hide ToC by giving it class:hide, aria-hidden='true' and hidden=true.

Add props to control this new behavior autoHide=true and warnOnEmpty=true, document them in readme and add tests.

Also new <slot name="title" />.