@mozisan/next-layout
v1.0.4
Published
Simple & type-safe way to implement page layout for Next.js
Downloads
12
Readme
next-layout
Installation
npm i -S @mozisan/next-layout
Usage
// pages/foo.tsx
import { defineLayout } from "@mozisan/next-layout";
const withLayout = defineLayout((page) => (
<div>
<header>...</header>
<main>{page}</main>
</div>
));
export default withLayout(function FooPage() {
return <div>...</div>;
});
// pages/_app.tsx
import type { AppProps } from "next/app";
import { PageRenderer } from "@mozisan/next-layout";
export default function App(props: AppProps) {
return <PageRenderer {...props} />;
}