Next.js
Load the stylesheet in the App Router layout and use Monoline from Server and Client Components.
Installation
Install the packages
npm install @monoline/react @monoline/cssLoad the stylesheet in the layout
App Router. Import it once, before your own CSS.
app/layout.tsximport '@monoline/css'; export default function RootLayout({children}: {children: React.ReactNode}) { return <html lang="en"><body>{children}</body></html>; }Use a component
Components that use state or handlers carry
'use client'themselves, so a Server Component file can import and render them.app/page.tsximport {Button} from '@monoline/react'; export default function Page() { return <Button>Save</Button>; }
Theme and accent
Set the attributes on <html> so the first paint already has the right look.
app/layout.tsx
<html lang="en" data-theme="warm" data-accent="blue">