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.
Learn how to install the Skeleton core into your Astro project. We’ll cover using components in the section below.
Create a Project
Start by creating a new Astro project. We recommend selecting all default options.
Install Tailwind
Install Tailwind using Astro Add:
Install Skeleton
Install the Skeleton core package for the Tailwind plugin. Once again, please note this does not include components.
Configure Tailwind
Open tailwind.config
in the root of your project and make the following changes:
Remove Default Content and Styles
We recommend you open /src/components/welcome.astro
and remove all default HTML and CSS. Here’s a simple starter layout.
Set Active Theme
Open /src/layouts/Layout.astro
, then set the data-theme
attribute on the body tag to define the active theme.
Run the Project
Start the dev server using the following command.
Using Components in Astro
While Astro can support multiple Frontend frameworks, please be aware this comes with some notable restrictions:
- With the exception of this experimental flag for React children, components cannot utilize slotted content in
.astro
files. - You will need to install additional packages for both Astro and Skeleton per your framework of choice.
- You may need a wrapper component to use to utilize all component feature. We’ll demo this below.
Astro Framework Packages
Install only the Astro framework(s) packages you intend to use.
https://docs.astro.build/en/guides/integrations-guide/react/
https://docs.astro.build/en/guides/integrations-guide/svelte/
Skeleton Framework Packages
Install only the Skeleton framework(s) packages you intend to use.
Configure Tailwind
Open tailwind.config
in the root of your project and make these changes. First, include the contentPath
import.
Then append content
for ONLY the framework(s) you intend to use.
Using Wrapper Components
In most cases, frontend framework components may not be fully functional if used directly within .astro
files. To overcome this, you may utilize a wrapper component of that framework. Here’s a demo using the Skeleton Avatar component as an example.
React
Svelte
Run the Project
Start the dev server using the following command.