Skip to content

feat(docs): Add scroll-to-top button on documentation pages #179

@adity1raut

Description

@adity1raut

Summary

Long documentation pages require users to manually scroll back to the top,
which is a poor UX — especially on API reference pages with many DocSection entries.

Proposed Solution

Add a fixed "scroll to top" button that:

  • Appears in the bottom-right corner after the user scrolls down 300px
  • Smoothly scrolls back to the top on click
  • Adapts to light and dark mode using existing CSS variables
  • Is injected globally via Docusaurus's Root theme swizzle so it works on all doc pages

Implementation

  • New component: src/components/ScrollToTopButton/
  • Theme override: src/theme/Root.js (Docusaurus Root swizzle pattern)
  • No changes needed to individual page or layout components

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions