Next.js - Skeleton

Skeleton

You are viewing the archived Skeleton v3.0 documentation.
  1. get started
  2. installation
  3. nextjs

Next.js

Install and configure Skeleton for Next.js.

Requirements

ToolingMinimum Supported
Next.js15
React18
Tailwind4

Installation

1

Create a Project

Use the Next.js CLI to scaffold a new project.

Terminal window
npm create next-app@latest my-skeleton-app
cd my-skeleton-app
2

Install Skeleton

Install the Skeleton core and React component packages.

Terminal window
npm i -D @skeletonlabs/skeleton @skeletonlabs/skeleton-react
4

Configure Tailwind

Open your global stylesheet in /src/app/globals.css and add the following imports:

globals.css
@import 'tailwindcss';
@import '@skeletonlabs/skeleton';
@import '@skeletonlabs/skeleton/optional/presets';
@import '@skeletonlabs/skeleton/themes/cerberus';
@source '../../node_modules/@skeletonlabs/skeleton-react/dist';

NOTE: make sure the @source path resolves correctly for your application structure.

5

Set Active Theme

Open /src/app/layout.tsx, then set the data-theme attribute on the HTML tag to define the active theme.

layout.tsx
<html data-theme="cerberus">...</html>

Done

Start the dev server using the following command.

Terminal window
npm run dev