xl vision
  • Component
  • React Hooks
  • Playground
  • Overview
  • Color
  • Getting Start
    • Installation
  • General
    • Icon
    • Button
  • Layout
    • Grid
  • Form
    • Input
    • InputNumber
    • Textarea
  • Navigation
    • Dropdown
    • Affix
    • BackTop
    • Anchor
  • Data Display
    • Tooltip
    • Popover
    • Avatar
  • Faceback
    • Popconfirm
    • Dialog
    • Message
    • Notication
  • Animation
    • Transition
    • TransitionGroup
    • CollapseTransition
    • Ripple
  • Styles
    • Theme
    • CssBaseline
  • Basic Component
    • BaseButton
    • Portal
    • Popper
    • Modal
    • ResizeObserver

BackTop

Return to the action buttons at the top of the page.

Examples

Scroll down to see the bottom-right gray button.
Basic usage

Basic usage

Scroll down to see the bottom-right blue button.
Custom content

Custom content

BackTop keeps showing
Controlled state

In the controlled state, the display state of BackTop is completely controlled by the user.

Properties

PropertyDescriptionTypeDefaultRequire
targetSet the element whose scroll event needs to be listened to. The value is a function that returns the corresponding DOM elementWindow | HTMLElement | (() => Window | HTMLElement)() => windowfalse
containerSpecifies the container for BackTop renderingElement | (() => Element);() => document.bodyfalse
bottomdistance from bottomnumber40false
rightdistance to the rightnumber40false
showSpecify whether to display, controlled modeboolean-false
onChangeBackTop state change callback(show:boolean) => void-false
visibilityHeightThe height that triggers the display to return to the top when scrollingnumber300false
childrencustom elementReact.ReactNode-false
Examples
Basic usage
Custom content
Controlled state
Properties
Copyright © 2020-2021 Rhys Xia