### Install and Run Commands
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/get-started.md
Commands used to initialize dependencies and start the development server within the monorepo.
```bash
pnpm i
```
```bash
pnpm dev
```
--------------------------------
### Install Skeleton Packages
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/sveltekit.md
Install the core and Svelte component packages for Skeleton.
```bash
npm i -D @skeletonlabs/skeleton @skeletonlabs/skeleton-svelte
```
--------------------------------
### Install Skeleton React Package
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Install the Skeleton UI package for React projects.
```bash
@skeletonlabs/skeleton-react
```
--------------------------------
### Install Melt UI
Source: https://www.skeleton.dev/docs/svelte/integrations/melt-ui.md
Install the Melt UI package using your preferred package manager.
```bash
npm install melt
```
--------------------------------
### Start the development server
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/nextjs.md
Launch the local development environment.
```bash
npm run dev
```
--------------------------------
### Install Floating UI
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/floating-ui-attachments.md
Install the standard Floating UI DOM package via npm.
```bash
npm install @floating-ui/dom
```
--------------------------------
### Install Tailwind Forms plugin
Source: https://www.skeleton.dev/docs/svelte/tailwind-components/forms.md
Command to install the required dependency for form styling.
```sh
npm install -D @tailwindcss/forms
```
--------------------------------
### Install Bits UI and Date Dependencies
Source: https://www.skeleton.dev/docs/svelte/integrations/bits-ui.md
Install the required Bits UI package and the internationalized date library for handling date formatting.
```bash
npm install bits-ui
```
```bash
npm i -D @internationalized/date
```
--------------------------------
### Create a Basic Tooltip
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/floating-ui-attachments.md
Usage example for a tooltip, demonstrating configuration adjustments for interaction and placement.
```svelte
TooltipRaw
```
--------------------------------
### Install Skeleton Svelte Package
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Install the Skeleton UI package for Svelte projects.
```bash
@skeletonlabs/skeleton-svelte
```
--------------------------------
### Install Astro React Integration
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Use this command to add React support to your Astro project. Ensure you have npx installed.
```bash
npx astro add react
```
--------------------------------
### Basic Button Examples
Source: https://www.skeleton.dev/docs/svelte/tailwind-components/buttons.md
Demonstrates creating icon-only, standard, and button-with-icon elements using Astro components. Requires 'lucide-react' for icons.
```astro
---import { ArrowRightIcon } from 'lucide-react';---
```
--------------------------------
### Install Skeleton Core
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Add the Skeleton core package as a development dependency.
```bash
npm i -D @skeletonlabs/skeleton
```
--------------------------------
### Applying Color Pairings
Source: https://www.skeleton.dev/docs/svelte/design/colors.md
Examples of using the condensed syntax for color pairings.
```html
...
...
```
--------------------------------
### Install Astro Svelte Integration
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Use this command to add Svelte support to your Astro project. Ensure you have npx installed.
```bash
npx astro add svelte
```
--------------------------------
### Install Skeleton dependencies
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/nextjs.md
Add the core and React component packages to your project as dev dependencies.
```bash
npm i -D @skeletonlabs/skeleton @skeletonlabs/skeleton-react
```
--------------------------------
### Complete Calendar Example with Styles and Configuration
Source: https://www.skeleton.dev/docs/svelte/integrations/bits-ui.md
A full implementation of the Calendar component demonstrating various styling options and basic configuration, including date unavailability and fixed weeks.
```svelte
{#snippet children({ months, weekdays })}
←→
{#each months as month, i (i)}
{#each weekdays as day}
{day.slice(0, 2)}
{/each}
{#each month.weeks as weekDates}
{#each weekDates as date}
{date.day}
{/each}
{/each}
{/each}
{/snippet}
```
--------------------------------
### Outlined Preset Configuration
Source: https://www.skeleton.dev/docs/svelte/design/presets.md
Syntax and implementation examples for the outlined preset, designed for minimal interfaces.
```txt
preset-outlined
preset-outlined-{color}-{shade}-{shade}
```
```astro
{/* Neutral */}
{/* Colors */}
```
--------------------------------
### Color Scheme Examples
Source: https://www.skeleton.dev/docs/svelte/guides/mode.md
Demonstrates using Skeleton's color scheme feature with Tailwind. The first example uses a default color pairing that adapts to dark mode. The subsequent examples explicitly set the scheme to light or dark using `scheme-light` and `scheme-dark` classes.
```html
Light or Dark
Always Light Scheme
Always Dark Scheme
```
--------------------------------
### Create a Basic Popover
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/floating-ui-attachments.md
Usage example for a standard popover using the custom Popover attachment class.
```svelte
PopoverRaw
```
--------------------------------
### Install Radix Toggle Group
Source: https://www.skeleton.dev/docs/svelte/integrations/radix-ui.md
Install the specific Radix UI package required for the Toggle Group component.
```bash
npm install @radix-ui/react-toggle-group
```
--------------------------------
### Basic Slider Example
Source: https://www.skeleton.dev/docs/svelte/framework-components/slider.md
A fundamental example of the Slider component with a single thumb and default markers.
```svelte
Label
```
--------------------------------
### Basic Breadcrumbs Example
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/breadcrumbs.md
Displays a simple breadcrumb navigation structure using HTML and Svelte.
```svelte
```
--------------------------------
### Tonal Preset Configuration
Source: https://www.skeleton.dev/docs/svelte/design/presets.md
Syntax and implementation examples for the tonal preset, suitable for alerts and auxiliary actions.
```txt
preset-tonal
preset-tonal-{color}
```
```astro
{/* Neutral */}
{/* Colors */}
```
--------------------------------
### Install Shiki via NPM
Source: https://www.skeleton.dev/docs/svelte/integrations/code-block.md
Use this command to add the Shiki package to your project dependencies.
```bash
npm install -D shiki
```
--------------------------------
### Toast Placement Configuration
Source: https://www.skeleton.dev/docs/svelte/framework-components/toast.md
Configure the global screen position of toasts by setting the `placement` value in your `createToaster` instance. Example shown is 'bottom-end'.
```svelte
{#snippet children(toast)}
{toast.title}{toast.description}
{/snippet}
```
--------------------------------
### Basic Toast Implementation
Source: https://www.skeleton.dev/docs/svelte/framework-components/toast.md
Implement a single Toast.Group instance in your root scope. This example shows how to trigger an info toast with a title and description.
```svelte
{#snippet children(toast)}
{toast.title}{toast.description}
{/snippet}
```
--------------------------------
### Configure Server-Side Pagination
Source: https://www.skeleton.dev/docs/svelte/framework-components/pagination.md
Examples for handling server-side pagination responses and binding them to the component.
```typescript
const res = {
"results": [...],
"pagination": {
"page": 1,
"limit": 10,
"count": 500,
}
}
```
```html
```
--------------------------------
### Filled Preset Configuration
Source: https://www.skeleton.dev/docs/svelte/design/presets.md
Syntax and implementation examples for the filled preset, which automatically handles contrast colors.
```txt
preset-filled
preset-filled-{color}-{lightModeShade}-{darkModeShade}
```
```astro
{/* Neutral */}
{/* Colors */}
```
--------------------------------
### Basic Tooltip with Top Positioning
Source: https://www.skeleton.dev/docs/svelte/framework-components/tooltip.md
A basic tooltip example with the content positioned at the top. Ensure the necessary components are imported from '@skeletonlabs/skeleton-svelte'.
```svelte
HoverHello Skeleton
```
--------------------------------
### Applying Color Utilities
Source: https://www.skeleton.dev/docs/svelte/design/colors.md
Examples of applying color utilities to HTML elements and SVG icons.
```html
...
...
```
--------------------------------
### Switch with List Layout
Source: https://www.skeleton.dev/docs/svelte/framework-components/switch.md
Create a list of switches where each item has a label. This example iterates through labels and includes a horizontal rule between items, except for the last one. Requires importing the Switch component.
```svelte
{#each ['Label 1', 'Label 2', 'Label 3'] as label, i (label)}
{label}
{#if i < 2}
{/if}
{/each}
```
--------------------------------
### Floating Panel with Size Constraints
Source: https://www.skeleton.dev/docs/svelte/framework-components/floating-panel.md
This example shows how to apply size constraints to a Floating Panel using the `minSize` and `maxSize` props. The panel will be restricted to the specified dimensions when resized.
```svelte
Open Panel
Floating Panel
This panel has size constraints applied: minimum 300x200 pixels and maximum 900x600 pixels.
Try resizing from the bottom-right corner - the panel will respect these boundaries.
```
--------------------------------
### Defining Default Theme Stylesheet
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/dynamic-theming.md
Setup for a fallback theme using CSS imports and data-theme attribute selectors.
```css
@import 'tailwindcss';
@import '@skeletonlabs/skeleton';
@import './default.css';
```
```css
[data-theme='default'] {/* ... */}
```
--------------------------------
### Generate Changeset
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/get-started.md
Example of a changeset file used for versioning and changelog generation. Ensure the package name and version bump type are correct.
```markdown
---
'@skeletonlabs/skeleton-svelte': minor
---
feat: Added `Avatar` component.
```
--------------------------------
### Create Vite + Svelte Project
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/vite-svelte.md
Use npm to create a new Vite project with Svelte and TypeScript. Navigate into the project directory and install dependencies.
```bash
npm create vite@latest
- Set your project named as desired
- Set Svelte as the framework
- Set Typescript as the variant
cd {yourProjectName}
npm install
```
--------------------------------
### Svelte Component Part File Example
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/components.md
Defines the root component part for a Svelte component, including its props interface and script setup.
```svelte
```
--------------------------------
### Create a SvelteKit Project
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/sveltekit.md
Initialize a new SvelteKit project using the Svelte CLI.
```bash
npx sv create --types ts my-skeleton-app
cd my-skeleton-app
```
--------------------------------
### Create an Astro Project
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Initialize a new Astro project with Tailwind CSS support.
```bash
npm create astro@latest --add tailwind my-skeleton-app
cd my-skeleton-app
```
--------------------------------
### Create Starter Layout
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/astro.md
Define a basic Astro component layout using global styles and Skeleton classes.
```astro
---
import '../styles/global.css';
const framework = 'Astro';
---
Hello {framework}
This page is working.
```
--------------------------------
### Install Custom Fonts
Source: https://www.skeleton.dev/docs/svelte/design/themes.md
Install a font package via npm using Fontsource.
```bash
npm install @fontsource/open-sans
```
--------------------------------
### Basic Floating Panel Implementation
Source: https://www.skeleton.dev/docs/svelte/framework-components/floating-panel.md
This snippet demonstrates the basic setup for a Floating Panel. It includes imports for necessary icons and components, and structures the panel with a trigger, portal, positioner, content, header, body, and resize trigger.
```svelte
Open Panel
Floating Panel
This is a floating panel that can be dragged, resized, minimized, and maximized. Try dragging from the header or resizing from
the bottom-right corner.
```
--------------------------------
### Implement Skeleton Presets
Source: https://www.skeleton.dev/docs/svelte/design/presets.md
Demonstrates the basic usage of filled, tonal, and outlined presets within an Astro component.
```astro
---
const diagramCircle = 'preset-tonal w-8 aspect-square flex justify-center items-center rounded-full';
---
1
2
3
```
--------------------------------
### Selector Strategy HTML Example
Source: https://www.skeleton.dev/docs/svelte/guides/mode.md
Example of an HTML element with the `.dark` class applied to the `` tag to enable dark mode.
```html
```
--------------------------------
### Implement various input types
Source: https://www.skeleton.dev/docs/svelte/tailwind-components/forms.md
Demonstration of common HTML input types styled with Skeleton classes.
```astro
```
--------------------------------
### Basic Steps Implementation
Source: https://www.skeleton.dev/docs/svelte/framework-components/steps.md
Implement a multi-step process using the Steps component. Ensure the `Steps` component is imported from '@skeletonlabs/skeleton-svelte'.
```svelte
{#each steps as item, index}
{index + 1}
{item.title}
{#if index < steps.length - 1}
{/if}
{/each}
{#each steps as item, index}
{item.content}
{/each}
All done!
BackNext
```
--------------------------------
### Install Tailwind CSS and Vite Plugin
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/vite-svelte.md
Install Tailwind CSS and its Vite plugin. Implement the plugin in your vite.config.ts file, ensuring it comes before the Svelte plugin.
```bash
npm install tailwindcss @tailwindcss/vite
```
```typescript
import { defineConfig } from "vite";
import svelte from "@vitejs/plugin-svelte";
import tailwindcss from "@tailwindcss/vite"; // [!code ++]
export default defineConfig({
plugins: [
tailwindcss(), // [!code ++]
svelte() // <-- Must come after Tailwind
],
});
```
--------------------------------
### Install Tailwind CSS and Vite Plugin
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/vite-react.md
Install Tailwind CSS and its Vite plugin. Ensure the Tailwind plugin is added to your vite.config.ts file and comes before the React plugin.
```bash
npm install tailwindcss @tailwindcss/vite
```
```typescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite"; // [!code ++]
export default defineConfig({
plugins: [
tailwindcss(), // [!code ++]
react() // <-- Must come after Tailwind
],
});
```
--------------------------------
### Data Attribute Strategy HTML Example
Source: https://www.skeleton.dev/docs/svelte/guides/mode.md
Example of an HTML element with the `data-mode="dark"` attribute applied to the `` tag to enable dark mode.
```html
```
--------------------------------
### Scaffold a Next.js project
Source: https://www.skeleton.dev/docs/svelte/get-started/installation/nextjs.md
Initialize a new Next.js application using the official CLI.
```bash
npm create next-app@latest my-skeleton-app
cd my-skeleton-app
```
--------------------------------
### Trigger Message Addition
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/chat.md
Example of binding the addMessage function to a button click event.
```svelte
```
--------------------------------
### Basic Menu Implementation
Source: https://www.skeleton.dev/docs/svelte/framework-components/menu.md
Standard dropdown menu using a trigger and portal-based positioning.
```svelte
```
--------------------------------
### Branch Naming Conventions
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/get-started.md
Examples of semantic branch names using the required kebab-case format.
```text
docs/get-started-typo
bugfix/accordion-render-issue
```
--------------------------------
### Run Automated Migration
Source: https://www.skeleton.dev/docs/svelte/get-started/migrate-from-v2.md
Execute these commands sequentially to migrate your project to Skeleton v3 and v4 respectively.
```bash
npx skeleton@latest migrate skeleton-3
```
```bash
npx skeleton@latest migrate skeleton-4
```
--------------------------------
### Run Development Server Commands
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/components.md
Use these commands to run the development server for different projects within Skeleton.
```bash
pnpm doc dev
```
```bash
pnpm themes dev
```
```bash
pnpm react dev
```
```bash
pnpm svelte dev
```
--------------------------------
### Configure Deep Linking
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/table-of-contents.md
Examples of how to define an element ID and link to it using an anchor tag.
```html
Some Example Heading
```
```html
Some Example Heading
```
--------------------------------
### Basic Chip Styles
Source: https://www.skeleton.dev/docs/svelte/tailwind-components/chips.md
Demonstrates different chip variations: icon-only, text-only, and text with an icon. Ensure 'lucide-react' is imported for icon usage.
```astro
---import { CheckIcon } from 'lucide-react';---
```
--------------------------------
### Implement CodeBlock Component Usage
Source: https://www.skeleton.dev/docs/svelte/integrations/code-block.md
Example of how to utilize the custom CodeBlock component within a Svelte page.
```svelte
```
--------------------------------
### Import Lightswitch Component in App
Source: https://www.skeleton.dev/docs/svelte/guides/cookbook/light-switch.md
Integrate the created Lightswitch component into your main application file.
```svelte
```
--------------------------------
### Run automated migration CLI
Source: https://www.skeleton.dev/docs/svelte/get-started/migrate-from-v3.md
Execute the automated migration command to handle initial package and stylesheet updates. Manual steps are still required afterward.
```bash
npx skeleton@latest migrate skeleton-4
```
--------------------------------
### Zag Avatar Component HTML Structure
Source: https://www.skeleton.dev/docs/svelte/resources/contribute/components.md
Example of the DOM structure for the Zag Avatar component, illustrating its core elements.
```html
...
```
--------------------------------
### Basic Dialog Implementation
Source: https://www.skeleton.dev/docs/svelte/framework-components/dialog.md
Use this snippet to create a standard modal dialog. It requires importing Dialog, Portal, and XIcon components. The animation class is optional and can be defined inline.
```svelte
```
--------------------------------
### Basic Carousel Example
Source: https://www.skeleton.dev/docs/svelte/framework-components/carousel.md
A standard carousel implementation with navigation controls and indicators. Ensure slides are properly defined and passed to the component.
```svelte
←BackToggle AutoplayNext→
{#each slides as slide, i}
{slide.title}
{/each}
{#snippet children(carousel)}
{#each carousel().pageSnapPoints as _, index}
{/each}
{/snippet}
```
--------------------------------
### Slider with Multiple Thumbs
Source: https://www.skeleton.dev/docs/svelte/framework-components/slider.md
Enables selection of a range by providing an array with two values to `defaultValue`, creating start and end thumbs.
```svelte
```
--------------------------------
### Basic App Bar Usage
Source: https://www.skeleton.dev/docs/svelte/framework-components/app-bar.md
A standard App Bar with lead, headline, and trail elements. Imports necessary icons and the AppBar component.
```svelte
Skeleton
```
--------------------------------
### Use Native Progress Element
Source: https://www.skeleton.dev/docs/svelte/framework-components/progress-linear.md
Demonstrates styling the standard HTML progress element.
```html
```