This guide will help you scaffold a basic Skeleton-powered app within SvelteKit.

Getting Started

To begin, let's make a couple quick modifications to our app. Doing this ensures our layout will display properly.

Update App.html

Open /src/app.html and add the following classes to the wrapping div in /src/app.html. This element is required and display: content should remain.

	<div style="display: content" class="h-full overflow-hidden">%sveltekit.body%</div>

Note that you can optionally enable Dark Mode for your app by adding .dark to the HTML element at the top of app.html.

<html lang="en" class="dark">

Global Stylesheet

Open your global stylesheet in /src/app.postcss. Remove the @tailwind directives and replace the contents of the file with the following.

html, body { @apply h-full overflow-hidden; }

Layout Setup

Our page needs a bit of structure, so let's implement the Skeleton App Shell component. Add the following markup to your root layout in /src/routes/+layout.svelte.

    import '@skeletonlabs/skeleton/themes/theme-skeleton.css';
    import '@skeletonlabs/skeleton/styles/all.css';
    import '../app.postcss';

    import { AppShell, AppBar } from '@skeletonlabs/skeleton';

    <!-- Header -->
    <svelte:fragment slot="header">(header)</svelte:fragment>
    <!-- Sidebar -->
    <svelte:fragment slot="sidebarLeft">(sidebar)</svelte:fragment>
    <!-- Page Content Slot -->
    <slot />

Add the App Bar

Next, let's add a header element using Skeleton's App Bar component. Replace "Skeleton" with your application name and customize the GitHub link as desired.

<svelte:fragment slot="header">
    <!-- Insert the App Bar: -->
		<svelte:fragment slot="lead">
		<svelte:fragment slot="trail">
			<a class="btn btn-sm" href="" target="_blank" rel="noreferrer">GitHub</a>
	<!-- --- -->

Add Sidebar Navigation

Let's customize our App Shell's sidebar slot to make it stand out a bit more. Add the following Tailwind utility classes to the slotSidebarLeft prop.

<AppShell slotSidebarLeft="bg-surface-500/5 w-56 p-4">

After that, let's implement a Tailwind Elements navigation list within the App Shell's left sidebar slot.

<svelte:fragment slot="sidebarLeft">
	<!-- Insert the list: -->
	<nav class="list-nav">
			<li><a href="/">Home</a></li>
			<li><a href="/about">About</a></li>
	<!-- --- -->

Page Setup

Now let's add some basic content to our homepage. Open /src/routes/+page.svelte and replace the contents with the following. This will provide multiple "Tailwind Elements" styled by the all.css stylesheets.

<div class="container mx-auto p-8 space-y-8">
	<h1>Hello Skeleton</h1>
	<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
	<hr />
	<section class="card card-body">
		<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
	<hr />
	<section class="flex space-x-2">
      <a class="btn btn-filled-primary" href="" target="_blank" rel="noreferrer">SvelteKit</a>
      <a class="btn btn-filled-accent" href="" target="_blank" rel="noreferrer">Tailwind</a>
      <a class="btn btn-filled-tertiary" href="" target="_blank" rel="noreferrer">GitHub</a>

Add a Component

Finally let's implement Skeleton's Gradient Heading component. Import the component and replace the H1 heading on the page with the following. Feel free to adjust the settings and text as you wish.

    import { GradientHeading } from '@skeletonlabs/skeleton';

<GradientHeading tag="h1" direction="bg-gradient-to-br" from="from-primary-500" to="to-accent-500">