Skip to content

wahid-ari/next-tailwind-headlessui

Repository files navigation

Next.js + Tailwind CSS + Headless UI Example

This example shows how to use Tailwind CSS (v2.2) with Next.js. It follows the steps outlined in the official Tailwind docs.

It uses the new Just-in-Time Mode for Tailwind CSS.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-tailwindcss with-tailwindcss-app
# or
yarn create next-app --example with-tailwindcss with-tailwindcss-app

How to run dev

yarn dev

Installation Headless UI

To get started, install Headless UI via npm or yarn:

yarn add @headlessui/react

Installation Heroicons React

First, install @heroicons/react from yarn:

yarn add @heroicons/react

Deploy it to the cloud with Vercel (Documentation).