useScrollTop
useScrollTop is a hook that provides a way to scroll to the top of a container.
Usage#
import { useScrollTop } from '@primereact/hooks';const scrollTop = useScrollTop();Examples#
Basic#
useScrollTop listens window scroll by default.
The component referenced as hooks:usescrolltop:basic-demo is unavailable or does not exist.
Setting the target option binds useScrollTop to this element that has scrolling content.
Element#
The component referenced as hooks:usescrolltop:element-demo is unavailable or does not exist.