A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.flowbite-react.com/docs/guides/nextjs below:

Use with Next.js - Flowbite React

This guide provides three ways to integrate Flowbite React with Next.js:

  1. Quick Start: Create a new project with everything pre-configured
  2. Add to Existing Project: Add Flowbite React to an existing Next.js project
  3. Manual Setup: Set up everything from scratch manually

Quick Start (Recommended)

Quick Start#

The fastest way to get started is using our project creation CLI, which sets up a new Next.js project with Flowbite React, Tailwind CSS, and all necessary configurations:

npx create-flowbite-react@latest -t nextjs

This will:

Add to Existing Project

Add to Existing Project#

If you already have a Next.js project and want to add Flowbite React, you can use our initialization CLI:

npx flowbite-react@latest init

This will automatically:

Manual Setup

Manual Setup#

If you prefer to set everything up manually or need more control over the configuration, follow these steps:

1. Create Project#

Create a new Next.js project:

When prompted:

npx create-next-app@latest
2. Install Flowbite React#

Install Flowbite React:

npx flowbite-react@latest init

This will:

3. Configure Dark Mode (Optional)#

To avoid page flicker in dark mode before hydration, add the ThemeModeScript to your root layout:

For App Router:


import { ThemeModeScript } from "flowbite-react";

export default function RootLayout({ children }) {
  return (
    <html suppressHydrationWarning>
      <head>
        <ThemeModeScript />
      </head>
      <body>{children}</body>
    </html>
  );
}

For Pages Router:


import { ThemeModeScript } from "flowbite-react";

export default function Document() {
  return (
    <Html suppressHydrationWarning>
      <Head>
        <ThemeModeScript />
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}
Try it out#

Now that you have successfully installed Flowbite React you can start using the components from the library:


import { Button } from "flowbite-react";

export default function Page() {
  return <Button>Click me</Button>;
}
Templates# Official#

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4