BackTop
A floating button that appears after scrolling down and jumps back to the top.
Draft launch checklist
ResearchBook crew interviews
OpsIcon audit
DesignOffline sync for tasks
EngHarbour homepage
DesignBrand palette
DesignRota export
OpsDraft launch checklist
ResearchBook crew interviews
OpsIcon audit
DesignOffline sync for tasks
EngHarbour homepage
DesignBrand palette
DesignRota export
OpsDraft launch checklist
ResearchBook crew interviews
OpsIcon audit
DesignOffline sync for tasks
EngHarbour homepage
DesignBrand palette
DesignRota export
OpsIn context
Draft launch checklist
Research, Fri
Book crew interviews
Ops, no due date
Icon audit
Design, no due date
Offline sync for tasks
Eng, no due date
Harbour homepage
Design, no due date
Brand palette
Design, no due date
Rota export
Ops, no due date
Draft launch checklist
Research, Fri
Book crew interviews
Ops, no due date
Icon audit
Design, no due date
Offline sync for tasks
Eng, no due date
Harbour homepage
Design, no due date
Brand palette
Design, no due date
Rota export
Ops, no due date
Draft launch checklist
Research, Fri
Book crew interviews
Ops, no due date
Icon audit
Design, no due date
Offline sync for tasks
Eng, no due date
Harbour homepage
Design, no due date
Brand palette
Design, no due date
Rota export
Ops, no due date
Props
| Prop | Type | Required | Default |
|---|---|---|---|
visibilityThreshold | number | undefined | No | 300 |
target | (() => HTMLElement | Window) | undefined | No | () => window |
onClick | (() => void) | undefined | No | — |
children | ReactNode | No | — |
className | string | undefined | No | — |
target
target?: () => HTMLElement | Window (default () => window) is a deliberate function-prop exception: there is no serializable way to name the window or a scroll container. It chooses what is tracked and scrolled; the button itself is position: fixed, so a demo box needs a transform to contain it.
Reduced motion
Scrolling back uses smooth scroll unless prefers-reduced-motion is set, in which case it jumps. Checked via matchMedia.
data-rebar-* attributes
data-rebar-component="back-top" on the button.
Migrating to Ant Design
AntD's BackTop is a close direct equivalent: visibilityThreshold, target and onClick map directly.