SvelteKit - Skeleton

Skeleton

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

SvelteKit

Install and configure Skeleton for SvelteKit.

Requirements

ToolingMinimum Supported
SvelteKit2
Svelte5
Tailwind4

Installation

1

Create a Project

Use the Svelte CLI to generate a new SvelteKit project.

Terminal window
npx sv create --types ts my-skeleton-app
cd my-skeleton-app

NOTE: If you did not select the options to add Tailwind, use npx sv add tailwindcss to add it retroactively.

2

Install Skeleton

Install the Skeleton core and Svelte component packages.

Terminal window
npm i -D @skeletonlabs/skeleton @skeletonlabs/skeleton-svelte
3

Configure Tailwind

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

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

NOTE: please verify the @source path resolves to your node_modules directory.

4

Set Active Theme

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

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

Done

Start the dev server using the following command.

Terminal window
npm run dev