BackToTop
Appears after scrolling a long page down; takes the person back to the top.
import { BackToTop } from '@sypnia/ui/react'
On this page
On this page
Scroll the page down past 800 pixels and look at the bottom right corner.
Code
import { BackToTop } from '@sypnia/ui/react';
// Scroll this page down: the button appears at the bottom right.
export default function Top() { return <><p>Scroll the page down past 800 pixels and look at the bottom right corner.</p><BackToTop /></>; } When to use it
Use it when
- Long pages: docs, changelogs, long lists.
Do not use it when
- Short pages, or pages with a sticky navigation already in reach.
For everyone
- It is a button named «Back to top»; on phones it sits above the bottom bar.
Props
| BackToTop | Type | Default |
|---|---|---|
after | number | 800 |