Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

amorriscode/use-overflow

Repository files navigation

use-overflow

A React Hook that allows you to detect X and Y overflow.

NPM JavaScript Style Guide

Install

npm install --save use-overflow
OR
yarn add use-overflow

Usage

Check out the live example.

import * as React from 'react'
import { useOverflow } from 'use-overflow'
const Example = () => {
 const horizontalRef = React.useRef(null);
 const { refXOverflowing, refXScrollBegin, refXScrollEnd } = useOverflow(horizontalRef);
 const verticalRef = React.useRef(null);
 const { refYOverflowing, refYScrollBegin, refYScrollEnd } = useOverflow(verticalRef);
 return (
 <div>
 {/* Conditional do stuff based on overflow! */}
 </div>
 )
}

License

MIT © amorriscode


This hook is created using create-react-hook.

About

A React Hook that allows you to detect X and Y overflow

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

AltStyle によって変換されたページ (->オリジナル) /