Vite + React - Skeleton

Skeleton

  1. get started
  2. installation
  3. vite react

Vite + React

Install and configure Skeleton for Vite + React.

Requirements

ToolingMinimum Version
Vite6
React18
Tailwind4

Installation

WARNING: The following guide will install a pre-release version of Skeleton v3. Some features may be missing, incomplete, or non-functional at this time. Please report bugs and issues on GitHub or Discord.

1

Create a Project

Start by creating a new Vite project. This will install React and Typescript.

Terminal window
npm create vite@latest my-skeleton-app -- --template react-ts
cd my-skeleton-app
npm install
2

Install Skeleton

Install the Skeleton core and React component packages.

Terminal window
npm i -D @skeletonlabs/skeleton@next @skeletonlabs/skeleton-react@next
3

Install Tailwind

Install Tailwind and and the Tailwind Vite plugin.

Terminal window
npm install tailwindcss @tailwindcss/vite

Implement the plugin in vite.config in the root of your project.

vite.config
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
tailwindcss(),
],
})
4

Configure Tailwind

Locate your global stylesheet and append the following at the top of the file.

@import 'tailwindcss';
@import '@skeletonlabs/skeleton';
@import '@skeletonlabs/skeleton/optional/presets';
@import '@skeletonlabs/skeleton/themes/cerberus';
5

Set the Active Theme

Open index.html, then set the data-theme attribute on the HTML tag to define the active theme.

index.html
<html data-theme="cerberus">...</html>

Done

Start the dev server using the following command.

Terminal window
npm run dev