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;

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    139
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    139
  • 1.0.0
    0

Package Sidebar

Install

npm i react-use-overflow

Weekly Downloads

139

Version

1.0.1

License

MIT

Unpacked Size

9.28 kB

Total Files

19

Last publish

Collaborators

  • shahidraza7292