A minimal, lab-style Svelte + Vite + Tailwind CSS project with three example pages: a Study Goal form, a Simple Demo, and a vis-network (vis.js) interactive network.
A experimental playground built with:
Live demo: https://andreisugu.github.io/mySveltePlayground/
npm run dev or npm run build).src/
├── App.svelte # Main component, page switcher, and Study Goal form
├── SimplePage.svelte # Simplest demo page (input + display)
├── VisNetworkPage.svelte # vis-network (vis.js) interactive network demo
├── main.js # Entry point
└── app.css # Global styles, imports Tailwind v4
This project demonstrates a basic Svelte form with live feedback and validation, styled using Tailwind CSS v4. It is designed to be as beginner-friendly and minimal as possible, while still showing real-world Svelte and Tailwind usage.
Key Svelte concepts shown:
bind:value)$: ...){#if ...})Key Tailwind concepts shown:
npm install
npm run dev
Open the printed URL (usually http://localhost:5173) in your browser.src/App.svelte.src/SimplePage.svelte.src/VisNetworkPage.svelte.src/app.css (using Tailwind v4).vite.config.js and tailwind.config.js.index.html # HTML entry point vite.config.js # Vite config tailwind.config.js # Tailwind config svelte.config.js # Svelte config
## Development
```bash
npm install
npm run dev
This starts a dev server at http://localhost:5173/
npm run build
Output goes to dist/
The site automatically deploys to GitHub Pages when you push to main via GitHub Actions.
The workflow builds the project and pushes to the gh-pages branch.
Want to add more components? Create .svelte files in src/lib/ and import them into App.svelte.
Modify App.svelte or add new .svelte files to experiment with:
Or try adding a new feature, like a priority dropdown, a todo list, or another minimal or interactive page!
You can also open an issue on this repo or fork and experiment safely!
MIT - See LICENSE for details
Want to build this same Svelte + Vite + Tailwind v4 project yourself? Here’s how:
npm create vite@latest my-svelte-app -- --template svelte
cd my-svelte-app
npm install
npm install -D tailwindcss@^4 @tailwindcss/vite postcss autoprefixer
npx tailwindcss init
tailwind.config.js, set:export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: { extend: {} },
plugins: [],
}
src/app.css, replace everything with:@import "tailwindcss";
vite.config.js, add the plugin:import tailwindcss from '@tailwindcss/vite';
// ...existing code...
export default defineConfig({
plugins: [tailwindcss(), svelte()],
// ...existing config...
});
App.svelte with your form code.npm run dev
You now have a working Svelte + Vite + Tailwind v4 project, just like this one!