pages/_app.js:
import "../styles/globals.css"
import {NextUIProvider} from '@nextui-org/react'
function Application({ Component, pageProps }) {
return (
<NextUIProvider>
<Component {...pageProps} />
</NextUIProvider>
)
}
export default Application;
pages/index.js
import Head from 'next/head'
import Header from '../components/Header'
import Footer from '../components/Footer'
export default function Home() {
return (
<div className="container">
<Head>
<title>Next.js Starter!</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<main>
<Header title="Welcome to my app!" />
<p className="description">
Get started by editing <code>pages/index.js</code>
</p>
</main>
<Footer />
</div>
)
}
styles/globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
* {
box-sizing: border-box;
}
main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
}
.container {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}