Static
Static: Next.js
Use a Static cursor in a Next.js app with the App Router or Pages Router.
Generate the files
npm install --save-dev glint-cursors
npx cursor-static bold-arrow --variant light --out public/cursors
Files in public/ are served from the site root, so the CSS is at /cursors/bold-arrow-light.css.
App Router
Add the stylesheet in the root layout:
// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<link rel="stylesheet" href="/cursors/bold-arrow-light.css" />
</head>
<body>{children}</body>
</html>
);
}
Or put a single inlined CSS file (--inline) in app/cursors/ and import it as a global stylesheet: import './cursors/bold-arrow-light.css' in app/layout.tsx.
Pages Router
Import the inlined CSS in pages/_app.tsx, or add the <link> in pages/_document.tsx.
Only some routes
Generate with a scope, for example --scope ".marketing", and put className="marketing" on the wrapper of your marketing pages. Checkout, account and dashboard routes then keep the native cursor. See Scoping.