check
Code copied to clipboard.
close
menu

Theme

A context component that controls the global color scheme. Right now it does this by modifying inline styles on the :root element. This is not ideal, and it will be changed in later versions once we decide on a css-in-js solution.

Example Instance

import ThemeProvider from "@/registry/nextjs/components/theme";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body>
        <ThemeProvider>{children}</ThemeProvider>
      </body>
    </html>
  );
}
content_copy
warning
Note: The above snippet omits import statements and surrounding markup. It's assumed you'd be pasting this inside the return block of an existing functional component.

Installation

Next.js

Note: Other React frameworks are not currently supported, but they might still work. Try at your own risk.

Method Instructions
LiftKit CLI
From any Next.js project, run the following command in your terminal.
npm run add theme
content_copy
Github open_in_new View on Github

Props

Unique

Props unique to this component.

Common

Props with globally-defined behavior that are used in multiple components.