@supermousejs/react
v2.1.1
Published
React integration for Supermouse. Handles strict mode and cleanup automatically.
Downloads
15
Readme
@supermousejs/react
React integration for Supermouse. Handles strict mode and cleanup automatically.
Installation
pnpm add @supermousejs/react @supermousejs/coreUsage
In App.tsx:
import { SupermouseProvider } from '@supermousejs/react';
import { Dot } from '@supermousejs/dot';
export default function App() {
return (
<SupermouseProvider
options={{ smoothness: 0.15 }}
plugins={[ Dot({ size: 8 }) ]}
>
<YourApp />
</SupermouseProvider>
);
}In Components:
import { useSupermouse } from '@supermousejs/react';
const MyComponent = () => {
const mouse = useSupermouse(); // Returns Supermouse instance or null
return <div />;
};Documentation
Full documentation and interactive playground available at supermouse or check out the repo.
