SvelteKit - Skeleton

  1. get started
  2. installation
  3. sveltekit

SvelteKit

Install and configure Skeleton for SvelteKit.

WARNING: The following guide will install a pre-release version of Skeleton v3. Be aware that 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

Create a new Svelte 5 project using sv (the Svelte CLI). This generates a minimal project with Typescript enabled.

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

NOTE: make sure to select tailwind when prompted, otherwise 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@next @skeletonlabs/skeleton-svelte@next
3

Configure Tailwind

Open tailwind.config in the root of your project and make the following changes:

tailwind.config
import type { Config } from 'tailwindcss';
import { skeleton, contentPath } from '@skeletonlabs/skeleton/plugin';
import * as themes from '@skeletonlabs/skeleton/themes';
export default {
content: [
'./src/**/*.{html,js,svelte,ts}',
contentPath(import.meta.url, 'svelte')
],
theme: {
extend: {},
},
plugins: [
skeleton({
// NOTE: each theme included will increase the size of your CSS bundle
themes: [ themes.cerberus, themes.rose ]
})
]
} satisfies Config
4

Set Active Theme

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

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

Done

Start the dev server using the following command.

Terminal window
npm run dev