Skip to content
Playground

Skeleton

Installation

Terminal window
npm i @sjsf/form @sjsf/skeleton-theme

Install Skeleton

SvelteKit - Skeleton

Setup styles

There is two ways to setup styles:

  1. Use tailwindcss config
import { skeleton } from '@skeletonlabs/skeleton/plugin';
import * as themes from '@skeletonlabs/skeleton/themes';
import forms from '@tailwindcss/forms'
import { THEME_CONTENT } from '@sjsf/skeleton-theme/preset'
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{html,js,svelte,ts}', THEME_CONTENT],
plugins: [
forms,
skeleton({
themes: [/* themes.something */],
})
],
}
  1. Inject prepared styles (not recommended)
// Inject them as you like
import daisyStyles from "@sjsf/skeleton-theme/styles.css?inline";

Bundled themes:

  • cerberus
  • catppuccin
  • pine
  • rose

Demo

<script lang="ts">
import { theme } from "@sjsf/skeleton-theme";
import { astroTheme } from "@/theme.svelte";
import CustomForm from "@/components/custom-form.svelte";
import { schema, uiSchema } from "./_demo-schema";
const astro = astroTheme();
let value = $state();
</script>
<CustomForm
{...theme}
bind:value
{schema}
{uiSchema}
novalidate
onSubmit={console.log}
class="flex flex-col gap-4 {astro.darkOrLight}"
style="margin-bottom: 1rem;"
data-theme="cerberus"
/>
<pre>{JSON.stringify(value, null, 2)}</pre>