This documentation provides a comprehensive reference for the Skeleton v3 UI framework, featuring React examples.
If you are using a different JavaScript framework, please refer to the respective framework-specific documentation for examples.
Always utilize Skeleton UI components, classes, and styles whenever possible.
# Get Started
# Core API
Learn about the specific features Skeleton introduces to Tailwind.
{
The heart of Skeleton is our framework agnostic core package. This adapts and extends Tailwind to introduce our global styles, color
system, typography, and more. This section details all available Skeleton-provided utility classes and theme properties.
}
---
## @base
Extends Tailwind's base layer with a set of opinionated global styles.
View Global Styles
- Sets the root color scheme to match Dark Mode settings.
- Updates scrollbars to utilize theme colors.
- Updates global text selection to utilize theme colors.
- Defines the `` background colors and base font styles.
- Implements global default styles for disabled states, such as buttons.
## @theme
Uses Tailwind's `@theme` to implement a variety of new properties and utility classes.
View Theme Properties
### Colors
Extends colors to include the [Skeleton color palette](/docs/design/colors).
| Class | Theme Property |
| ------------------------------------- | ------------------------------------ |
| `[property]-[color]-[shade]` | {`--`}color-[color]-[shade] |
| `[property]-[color]-contrast-[shade]` | {`--`}color-[color]-contrast-[shade] |
| `body-color` | {`--`}body-background-color |
| `body-color-dark` | {`--`}body-background-color-dark |
### Color Pairings
Extends colors to implement [Color Pairing](/docs/design/colors#color-pairings), which balance colors between light and dark mode.
| Class | Theme Property |
| ------------------------------------ | ----------------------------------- |
| `[property]-[color]-[shade]-[shade]` | {`--`}color-[color]-[shade]-[shade] |
### Spacing
Integrates Tailwind's [spacing property](https://tailwindcss.com/docs/functions-and-directives#spacing-function) to modify [dynamic scaling](/docs/design/spacing) for various utility classes.
| Class | Theme Property |
| --------- | -------------- |
| (various) | {`--`}spacing |
### Typography
Introduces a [typographic scale](https://designcode.io/typographic-scales) to all Tailwind [font sizes](https://tailwindcss.com/docs/font-size) using the following formula.
```plaintext
--text-{size}: calc({remSize} * var(--text-scaling));
--text-{size}--line-height: calc(calc(1 / {remSize}) * var(--text-scaling));
```
#### Base
Controls the style of the global page text.
| Class | Theme Property |
| ---------------------- | -------------------------- |
| `base-font-color` | {`--`}base-font-color |
| `base-font-color-dark` | {`--`}base-font-color-dark |
| `base-font-family` | {`--`}base-font-family |
| `base-font-size` | {`--`}base-font-size |
| `base-line-height` | {`--`}base-line-height |
| `base-font-weight` | {`--`}base-font-weight |
| `base-font-style` | {`--`}base-font-style |
| `base-letter-spacing` | {`--`}base-letter-spacing |
#### Heading
Controls the style of the heading text.
| Class | Theme Property |
| ------------------------- | ----------------------------- |
| `heading-font-color` | {`--`}heading-font-color |
| `heading-font-color-dark` | {`--`}heading-font-color-dark |
| `heading-font-family` | {`--`}heading-font-family |
| `heading-font-size` | {`--`}heading-font-size |
| `heading-line-height` | {`--`}heading-line-height |
| `heading-font-weight` | {`--`}heading-font-weight |
| `heading-font-style` | {`--`}heading-font-style |
| `heading-letter-spacing` | {`--`}heading-letter-spacing |
#### Anchor
Controls the style of anchor links.
| Class | Theme Property |
| ------------------------------- | ----------------------------------- |
| `anchor-font-color` | {`--`}anchor-font-color |
| `anchor-font-color-dark` | {`--`}anchor-font-color-dark |
| `anchor-font-family` | {`--`}anchor-font-family |
| `anchor-font-size` | {`--`}anchor-font-size |
| `anchor-line-height` | {`--`}anchor-line-height |
| `anchor-font-weight` | {`--`}anchor-font-weight |
| `anchor-font-style` | {`--`}anchor-font-style |
| `anchor-letter-spacing` | {`--`}anchor-letter-spacing |
| `anchor-text-decoration` | {`--`}anchor-text-decoration |
| `anchor-text-decoration-active` | {`--`}anchor-text-decoration-active |
| `anchor-text-decoration-focus` | {`--`}anchor-text-decoration-focus |
| `anchor-text-decoration-hover` | {`--`}anchor-text-decoration-hover |
### Radius
Extends Tailwind's radius properties with theme-specific sizes.
| Class | Theme Property |
| ------------------- | ---------------------- |
| `rounded-base` | {`--`}radius-base |
| `rounded-container` | {`--`}radius-container |
### Edges
Sets the default width for border, divide, and ring width to match the active theme properties.
| Class | Theme Property |
| -------- | -------------------------- |
| `border` | {`--`}default-border-width |
| `ring` | {`--`}default-ring-width |
| `divide` | {`--`}default-divide-width |
## @utility
View Utilites
### Tailwind Components
Allow you to style semantic HTML elements with utility classes.
## @variant
View Variants
### Themes
Enables you to target and style elements for a particular theme.
```html
...
...
...
```
## Optional
### Presets
Provides a canned set of styles for use with buttons, badges, cards, and more.
Browse Presets
### Preset Themes
Provides a hand curated set of themes for Skeleton.
Browse Themes
---
# Fundamentals
An introduction to the core concepts of Skeleton.
{
Skeleton is comprised of three pillars - the design system, our extensions to Tailwind, and an optional suite of framework-specific
components. Together these form a comprehensive solution for designing and implementing complex web interfaces at scale.
}
---
## Design System
### Figma UI Kit
A fully featured [Figma UI Kit](/docs/get-started/figma) is available to designers, allowing them to quickly draft visual concept of your project.
### Iconography
Skeleton is icon agnostic, meaning you may bring your own iconography solution. However, we highly recommend [Lucide](https://lucide.dev/) and utilize it for all examples in our documentation. Refer to our integration guides for [React](/docs/integrations/iconography/react) and [Svelte](/docs/integrations/iconography/svelte).
### Core Features
The following features fall under the umbrella of our design system. Provided via the Skeleton core.
---
## Tailwind
Tailwind components that act as primitives for creating complex interfaces. Provided via the Skeleton core.
---
## Components
Skeleton also offers optional component packages for select frameworks, each component automatically adapt to Skeleton's design system.
| Framework | NPM Package | Description |
| --------- | ------------------------------- | ------------------------------------------------ |
| React | `@skeletonlabs/skeleton-react` | Contains all components and features for React. |
| Svelte | `@skeletonlabs/skeleton-svelte` | Contains all components and features for Svelte. |
### Powered by Zag.js
Skeleton's components are built on **Zag.js**, which provides a collection of framework-agnostic UI component patterns to manage logic and state. Zag was founded and maintained by industry veterans, such Segun Adebayo - the creator and core maintainer for [Chakra UI](https://www.chakra-ui.com/).
View Zag.js
### Importing Component
Import the component you wish to use from your framework package of choice, then insert it into your page template.
```ts
```
```ts
```
### Component Props
Skeleton components properties (aka "props") are loosely defined into the following categories:
- **Functional Props** - directly affect the functionality of the component, such as an `open` or `src`.
- **Style Props** - accept Tailwind utility classes to affect styling, such as `background` for background color.
- **Event Props** - callback functions that trigger upon interaction, such as `onclick`, `onkeypress`, and more.
In the example below, we set functional props for `src` and `alt`, while also including a style prop for `background`.
```ts
```
### Style Props
Skeleton components are styled by default out of the box. However, if you wish to customize the look and feel, then you may do so utilizing Style Props. These fall into a few sub-categories.
- `base` - the default styles for each component template element, implemented by default.
- `{property}` - take individual utility classes to customize styling, such as `background`, `padding`, or `margin`.
- `classes` - allows you to pass any arbitrary utility classes and extend the class list. Note this is plural.
Imagine the Avatar component was created like so:
```ts title="Example Props"
{
src = './some-placeholder.jpg',
alt = '',
// ...
base = 'flex justify-center items-center overflow-hidden',
background = 'bg-slate-500',
rounded = 'rounded-full',
// ...
classes = '',
}
```
```svelte title="Example Template"
```
We can use the `background` style prop to replace the default background color.
```svelte
Sk
```
Since the component doesn't have a dedicated `border` prop, we can extend our class list using `classes`.
```svelte
Sk
```
And we can optionally replace the default `base` styles like so. Just remember our other `{property}` styles will remain.
```svelte
Sk
```
Additionally, child elements within the template use these same conventions, but prefixed like `imageBase` and `imageClasses`.
```svelte
```
Consult each component's [API reference](/docs/components/accordion/react#api-reference) for a complete list of available properties.
### Learn More
For a comprehensive understanding of how Skeleton implements our components, please refer to our [contribution guidelines](/docs/resources/contribute/components).
---
# Installation
Learn how to install and setup Skeleton for your project.
## Mixing UI Libraries
Skeleton's design system is perfect for complementing headless component libraries, such as [Melt UI](https://www.melt-ui.com/), [Radix](https://www.radix-ui.com/), and [Zag.js](https://zagjs.com/). As well as "Tailwind component" libraries such as the [Tailwind UI](https://tailwindui.com/). Supporting any component system that supports Tailwind, but very specifically allows you to insert or substitute Skeleton-provided utility classes.
### Unsupported Libraries
Unfortunately, Skeleton cannot integrate with [Flowbite React](https://flowbite-react.com/), [Flowbite Svelte](https://flowbite-svelte.com/), or [Daisy UI](https://daisyui.com/) at this time. Similar to Skeleton, these libraries depend on their own dedicated Tailwind plugin that directly overlaps with many of our core features, including class names and color values.
---
# Introduction
Skeleton integrates with Tailwind to provide an opinionated solution for generating adaptive design systems. Including easy to use components for your favorite web frameworks.
## Our Philosophy
Skeleton provides a uniform design language and structured framework for controlling the look and feel of your product and user experience. It serves as an opinionated design system that aims to greatly reduce the amount of time spent managing design elements and patterns, allowing you to more quickly build and manage your frontend interfaces at scale.
{
Framework Agnostic
Skeleton's core features are framework agnostic, only requiring the use of{' '}
Tailwind CSS
. This provides full access to all design system features, while enabling you to standardize the design process for your framework of
choice.
Native-First
We aim to embrace the interface of the web, not replace it. This is why Skeleton defaults to semantic HTML elements and native browser
APIs. Beyond ease of use, we feel this offers a huge advantages to accessibility.
Simple Standards
We aim to standardize the design process, providing common conventions that are easy to learn and retain, whether you work alone or in
a team environment. Covering common fixtures such as themes, colors, typography, spacing, and more.
Utility-First
Skeleton embraces the{' '}
utility-first
{' '}
methodology for styling, supporting all features provided by{' '}
Tailwind
, while extending it's capabilities in meaningful ways. Providing full support for the encapsulated components of the modern web.
Opt-In by Default
Most features in Skeleton are modular and opt-in by default. Enabling interface features like buttons and typography via dedicated
utility classes. This allows for a simple escape hatch when you need to draw outside the lines and generate custom interfaces.
Adaptive
Skeleton is intended to adapt to the design and aesthetic of your project, while still providing reasonable defaults. Providing a
powerful{' '}
theme generator
{' '}
for custom themes, while also supplying a curated set of themes for those less design savvy.
}
## Additional Benefits
### Functional Components
Skeleton provides an optional suite of functional components built atop the foundation of [Zag.js](https://zagjs.com/). These components automatically adapt to the Skeleton design system out of the box. We currently support React and Svelte, with plans for other frameworks in the future.
### Open Source
Skeleton provides as [free and open-source software (FOSS)](https://github.com/skeletonlabs/skeleton) under the [MIT License](https://github.com/skeletonlabs/skeleton?tab=MIT-1-ov-file#readme).
### The Community
Skeleton boasts a vast community of users and contributors across [GitHub](https://github.com/skeletonlabs/skeleton), [Discord](https://discord.gg/EXqV7W8MtY), and [Bluesky](https://bsky.app/profile/skeletonlabs.bsky.social).
### Frequent Updates
Skeleton has maintained a set release cadence for years. Just take a look at our [changelog](https://github.com/skeletonlabs/skeleton/blob/dev/packages/skeleton/CHANGELOG.md).
### Figma UI Kit
Skeleton provides access to a fully featured [Figma UI Kit](/figma) to assist designers in drafting a visual concept of upcoming projects.
---
## Get Started
### Using Skeleton
Ready to get started? Check out our comprehensive [installation guides](/docs/get-started/installation) and begin [learning the fundamentals](/docs/get-started/fundamentals).
### Contributing
Please refer to our dedicated [Contribution Guidelines](/docs/resources/contribute) if you wish to contribute directly.
---
# Migrate from v2
Learn how to migrate from Skeleton v2 to the latest version.
{
WARNING: Skeleton v3 is currently in a pre-release status. It is not yet intended for production use. This may include bugs, incomplete
documentation, and breaking changes leading up to the full release. Depending on the scale and scope of of your project, we may even
encourage of your application to take full advantage of all changes.
}
## Introduction
Version 3 represents a major overhaul to Skeleton. This includes a ground up rewrite of quite literally every feature in the library. We have provided a migration CLI to help automate this process. However, some portions of this migration will still required manual intervention. This is not a trivial migration from prior versions, so please use caution when updating and ensure you follow this guide very carefully.
## Prerequisites
While Skeleton v3 introduces support for multiple frameworks, we’ve historically only supported SvelteKit. As such, this guide is only intended for users migrating from Skeleton v2 and SvelteKit. If you you are coming from another meta-framework, this will be outside the scope of this guide. However, this may still provide a valuable insight to the primary objectives for migration.
### Create a Migration Branch
We recommend you handle all migration changes on a dedicated feature branch. This ensures you can easily drop or revert changes if something goes wrong.
```shell
git checkout -b migration
```
### Prepare Your Skeleton App
Please make sure you have accounted for the following:
- Your app is running the latest release of Skeleton v2.x
- All critical dependencies have been updated (optional but recommended)
- Your app is in a functional state before you proceed
---
## Migrate Core Technologies
Skeleton is built on top of the following technologies. These must be migrated individually before proceeding with the Skeleton-specific migration. Note that Svelte and Tailwind provide dedicated CLIs to automate this process.
### Svelte v5
Migrate to the latest release of Svelte v5 ([migration guide](https://svelte.dev/docs/svelte/v5-migration-guide))
### SvelteKit v2
Migrate to the latest release of SvelteKit v2 ([migration guide](https://svelte.dev/docs/kit/migrating-to-sveltekit-2))
### Tailwind v4
Before migration to tailwind V4 using their upgrade guide some manual steps are required:
1. Remove the `skeleton` plugin from your `tailwind.config` file.
2. Rename your `app.postcss` or `app.pcss` to `app.css`.
3. Remove the `purgecss` (`vite-plugin-tailwind-purgecss`) vite plugin from your `vite.config` (if installed).
Migrate to the latest release of Tailwind v4 ([migration guide](https://tailwindcss.com/docs/upgrade-guide))
---
## Migrate to the Tailwind Vite Plugin
Use the following steps to migrate to from PostCSS to the Vite plugin:
1. Delete `postcss.config.mjs`
2. Run `npm uninstall postcss @tailwindcss/postcss`
3. Run `npm install @tailwindcss/vite`
4. Open your `vite.config` in the root of your project
5. Import the following at the top of the file: `import tailwindcss from '@tailwindcss/vite'`
6. Finally, add the Vite plugin ABOVE your specific framework plugin:
```ts
plugins: [
tailwindcss(),
sveltekit() // or svelte()
];
```
---
## Automated Migration
We’ve provided a dedicated migration script as part of the Skeleton CLI to help automate much of this process.
> TIP: Please ensure you've committed all pending changes before proceeding.
```console
npx @skeletonlabs/skeleton-cli migrate skeleton-3
```
What WILL be migrated...
- Update all required `package.json` dependencies
- Implement all required Skeleton imports in your global stylesheet `app.css`
- Modify `data-theme` in `app.html` if you’re using a Skeleton preset theme.
- Temporarily disable custom theme imports to allow for theme migration.
- Migrate all modified Skeleton utility classes (ex: `variant-*` to `preset-*`)
- Update all Skeleton imports throughout your entire project
- Renames all relevant Skeleton components
- Some Component imports will also be pruned as they are no longer supported. We’ll cover these features in detail below.
What will NOT be migrated...
- Component props will not be updated. Unfortunately there’s too many permutations.
- Most v2 Utility features will not be migrated (ex: popovers, code blocks, etc)
Make sure to consult your local Git Diff to compare what has been modified before progressing forward or committing these automated changes.
{
Early Adopters: In extremely rare instances the CLI may modify values outside the scope of Skeleton. If this occurs, please report this
as a bug in the #skeleton-cli-beta channel on Discord!
}
---
## Additional Migration
With automated migration complete, please follow the remaining manual migration steps.
### Migrate Themes
#### For Preset Themes
Your preset theme should be automatically migrated by the CLI, you're all set!
#### For Custom Themes
1. Use the [Import feature](https://themes.skeleton.dev/themes/import) provided by the new Theme Generator.
2. Drag and Drop your v2 theme into the file upload field.
3. Your theme will be automatically converted to the newest format.
4. Update and modify any theme settings in the live preview.
5. Make sure to set a valid theme name in the right-hand panel.
6. Tap the “Code” tab to preview your generated theme code.
7. Copy the theme code, then following our [custom theme instructions](/docs/design/themes#custom-themes).
8. Similar to preset themes, you will need to both register and set an active theme.
### Replace AppShell with Custom Layouts
Skeleton has sunset the ([troublesome](https://github.com/skeletonlabs/skeleton/issues/2383)) `` component in favor of user-defined custom layouts. We've provided a [Layouts](/docs/guides/layouts) guide for replicating common page structures using only semantic HTML and Tailwind - no Skeleton specific features needed!
### Migrating Components
Components have undergone the biggest update in Skeleton v3. Given the sheer number of changes, we recommend you compare each component to it's equivalent v3 documentation. We’ve highlighted a few of the key changes below:
- Changes to adopt the new [Svelte 5 APIs](https://svelte.dev/docs/svelte/v5-migration-guide) like runes, snippets, event handlers, etc.
- Changes to support [Zag.js](https://zagjs.com/), which serves as a foundation of our cross-framework components.
- Changes to the import path: `@skeletonlabs/skeleton-svelte`.
- Changes to the component name and/or structure (including sub-components)
- Changes based on newly introduces features and properties.
- Changes to adopt the new [style prop conventions](/docs/get-started/fundamentals#style-props) and cross-framework standardization.
Here's an example of changes for a single component from v2 to the new equivalent:
```svelte
```
```svelte
(value = e.value)} markers={[25, 50, 75]} />
```
We’ve denoted the most notable changes to each component in the table below:
| Name | v2 | v3 | Notes |
| ------------------ | ----------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `` | [Link](https://v2.skeleton.dev/components/app-rail) | [Link](/docs/components/navigation/svelte) | Renamed `` - greatly expanded features |
| `` | [Link](https://v2.skeleton.dev/components/file-buttons) | [Link](/docs/components/file-upload/svelte) | Renamed `` - merges `` features |
| `` | [Link](https://v2.skeleton.dev/components/file-buttons) | [Link](/docs/components/file-upload/svelte) | Renamed `` - merges `` features |
| `` | [Link](https://v2.skeleton.dev/components/input-chips) | [Link](/docs/components/tags-input/svelte) | Renamed `` |
| `` | [Link](https://v2.skeleton.dev/components/paginators) | [Link](/docs/components/pagination/svelte) | Renamed `` |
| `` | [Link](https://v2.skeleton.dev/components/progress-bars) | [Link](/docs/components/progress/svelte) | Renamed `