components/example.tsx
1
import { useScroll } from "passport-ui";components/example.tsx
1
2
3
4
5
const hasScrolled = useScroll(10); if (hasScrolled) { // Add a shadow to the header}A hook to detect if the page or a specific element has been scrolled.
Import the component from the passport-ui package.
import { useScroll } from "passport-ui";Basic example showing how to use the component.
const hasScrolled = useScroll(10); if (hasScrolled) { // Add a shadow to the header}Documentation and examples are available in Storybook.