Installation works just like shadcn/ui. Here's how to get started:
Create project
Run the init
command to create a new Next.js project or to set up 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. Then you can import and use it like this:
import { useWindowSize } from '@/hooks/guarahooks/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>
);
}