Installation
How to install dependencies and use the library
Note: We have the exact same installation process as shadcn/ui.
Create project
Run the init
command to create a new Next.js project or to setup an existing one:
Add components
You can now start adding components to your project.
Import hook
The command above will add the useWindowSize
hook to your project. Than you can import and use it like this:
import { useWindowSize } from '@/hooks/h3-use/use-window-size';
export default function Home() {
const { width, height } = useWindowSize();
return (
<div>
<h1>Window size</h1>
<p>Width: {width}</p>
<p>Height: {height}</p>
</div>
);
}