react-use-overflow
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-use-overflow determines whether an element exceeds its allotted size, causing overflow.

npm install react-use-overflow --save
import { useOverflow } from "react-use-overflow";

const App = () => {
  const { isOverflow, ref } = useOverflow<HTMLDivElement>();
  const { horizontal, vertical } = isOverflow;
  // horizontal(boolean) indicates horizontal overflow
  // vertical(boolean) indicates vertical overflow

  return <div ref={ref}>Content</div>;
};

export default App;

Package Sidebar

Install

npm i react-use-overflow

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

9.28 kB

Total Files

19

Last publish

Collaborators

  • shahidraza7292