Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Component: Table of Contents #357

Closed
endigo9740 opened this issue Oct 12, 2022 · 6 comments · Fixed by #751
Closed

New Component: Table of Contents #357

endigo9740 opened this issue Oct 12, 2022 · 6 comments · Fixed by #751
Assignees
Labels
feature request Request a feature or introduce and update to the project. ready to test Ready to be tested for quality assurance.
Milestone

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Oct 12, 2022

Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!

We need a new table of contents. We'll immediately put it to use in the Skeleton docs site, but seems like a great addition to the library itself too. This will allow quick navigation on long pages with a lot of content.

Here's a mock of where it would live on the page:

Screen Shot 2022-10-12 at 12 19 04 PM

Here's a full version of the page to compare:

image

Suggested features:

  • I love how Mantine's version updates automatically as you scroll up/down the page
  • Support subheadings, which are indented
  • Perhaps we implement data-* attributes on the headings to make the pairing process easier

Beyond that, this is open ended. Additional features and such as welcome!

What type of pull request would this be?

New Feature

Any links to similar examples or other references we should review?

References (see the right side of the page)

@endigo9740 endigo9740 added the feature request Request a feature or introduce and update to the project. label Oct 12, 2022
@benzara-tahar
Copy link
Contributor

Hi @endigo9740, I can take this one

@endigo9740 endigo9740 added the help wanted Extra attention is needed label Nov 4, 2022
@endigo9740 endigo9740 added this to the v1.0 milestone Nov 16, 2022
@endigo9740
Copy link
Contributor Author

@endigo9740 endigo9740 pinned this issue Dec 26, 2022
@endigo9740 endigo9740 self-assigned this Dec 29, 2022
@endigo9740 endigo9740 removed the help wanted Extra attention is needed label Dec 29, 2022
@endigo9740 endigo9740 linked a pull request Dec 29, 2022 that will close this issue
@endigo9740 endigo9740 added the ready to test Ready to be tested for quality assurance. label Dec 30, 2022
@endigo9740
Copy link
Contributor Author

This is now ready to begin testing. You can preview here:
https://skeleton-docs-git-feat-table-of-contents-skeleton-labs.vercel.app/components/table-of-contents

This has been added to the DocShell layout in our documentation, which means it will appear on most pages. It'll auto-hide on pages that have no relevant headings though.

Let me know if you come across any issues!

@endigo9740
Copy link
Contributor Author

I've made several new improvements today to the way we implement it into our doc page and how scrolling is handled. It should now be sticky and follow as you scroll, and the scrolling itself should be smooth and more accurate.

Screen Shot 2023-01-02 at 1 22 08 PM

@faiqali1
Copy link

faiqali1 commented Jan 3, 2023

If its the same as the link above, It doesn't follow the heading.

image

@endigo9740
Copy link
Contributor Author

@faiqali1 your comment doesn't give me much to go off of. I see you're trying to access a couple of the lower items on the page. The page can only scroll as far as it can scroll. If you run out of area it'll stop and that heading won't align with the top. Other than adding a ton of whitespace below the content there's not really a way around that.

Please clarify if this is not the issue you're seeing. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project. ready to test Ready to be tested for quality assurance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants