Getting Started with SvelteKit & Skeleton
Published on Jul 21, 2023
Getting started with SvelteKit!
SvelteKit is my preferred JavaScript front-end framework to work with at the moment, due to itβs amazing developer experience π§ and lighting-fast speeds β‘. It combines the best of Svelteβs efficient compilation with server-side rendering, leading to faster page loads and enhanced SEO performance. SvelteKitβs straightforward approach to state management, easy routing, and built-in componentization optimize the development process - resulting in a developer friendly codebase with easy troubleshooting and scaling.
Skeleton UI provides an beautiful Tailwind-driven component library for styling and building SvelteKit projects. You have access to all of the typcial styling classes/attributes you may be familiar with using Tailwind, in addition to awesome custom Svelte components and data stores. Check out this web application I built using SvelteKit and Skeleton:
River Dipper: a river recreation web application with real-time river flow data!
Now letβs start a project together
Letβs use Skeleton UI to start a new proejct
Make sure you have the latest version of Node.js installed on your machine, and then head on over to the command line. Make sure youβre in a directory where youβd like you project to live:
cd myFavoriteDirectory
npm create skeleton-app@latest my-skeleton-app
Youβll be taken through the normal steps for creating a new SvelteKit project, with a few Skeleton-specific twists. Let your own desires create your specific project details:
β Create Skeleton App (version 0.0.45)
Welcome to Skeleton π! A UI toolkit for Svelte + Tailwind
Problems? Open an issue on https://github.com/skeletonlabs/skeleton/issues if none exists already.
β
β Add type checking with TypeScript?
β β Yes, using TypeScript syntax
β β Yes, using JavaScript with JSDoc comments
β β No
β
β What would you like setup in your project:
β β» Add ESLint for code linting?
β β» Add Prettier for code formatting ?
β β» Add Playwright for browser testing ?
β β» Add Vitest for unit testing ?
β β» Add Svelte Inspector for quick access to your source files from the browser ?
For Tailwind forms/typography, CodeBlock, and Popups, I would recommend adding them all for maximum flexiblity - unless of course you know youβre never going to be using a codeblock - for example - in your app.
β What other packages would you like to install:
β β» Add Tailwind forms ?
β β» Add Tailwind typography ?
β β» Add CodeBlock (installs highlight.js) ?
β β» Add Popups (installs floating-ui) ?
And finally, select a theme from one of the awesome pre-built themes from Skeleton UI. Check out all of the themes in the docs here. Iβll be trying out Gold Nouveau, with the Skelton Welcome template (best for learning your way around).
β Select a theme:
β β Skeleton
β β Modern
β β Hamlindigo
β β Rocket
β β Sahara
β β Gold Nouveau
β β Vintage
β β Seafoam
β β Crimson
β
β Which Skeleton app template?
β β Bare Bones
β β Skeleton Welcome
β
Done! You can now:
cd my-skeleton-app
npm run dev