@c-side/next
v1.0.0
Published
Next.js component
Downloads
11
Readme
@c-side/next
Integrate c/side into your NextJS project with ease.
Installation
# npm
npm i @c-side/next
# yarn
yarn add @c-side/next
# pnpm
pnpm i @c-side/next
Usage
NextJS
Pages Router
// pages/_document.tsx
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { CSideScript } from '@c-side/next';
export default function Document() {
return (
<Html lang="en">
<Head>
<CSideScript /> {/* <- Here */}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
App Router
// layout.tsx
import { CSideScript } from '@c-side/next';
export default function Layout({ children }) {
return (
<>
<CSideScript /> {/* <- Here */}
{children}
</>
);
}