Skip to content

thoriqdharmawan/element-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Helper for your React Element 🌟🌟

Installation

npm i element-helpers

Usage

import { useGetDimensions } from "element-helpers";

function App() {
  const [refNode, { width, height }] = useGetDimensions();

  console.log("height : ", height); // 100
  console.log("width : ", width); // 300

  return (
    <div
      ref={refNode}
      style={{ width: 300, height: 100, backgroundColor: "red" }}
    />
  );
}

export default App;

Props

Name Required Information
refNode true You can change the name
width false
height false
bottom false
left false
right false
top false
x false
y false

About

Custom Hooks for your React Element 🌟🌟

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published