A modern, ready-to-use template combining the power of SvelteKit with the utility-first styling of TailwindCSS. Perfect for rapidly building beautiful, performant web applications.
Make sure you have Node.js (version 18 or higher) installed on your machine.
Clone this repository or use it as a template:
git clone <your-repo-url>
cd svelte-tailwindcss-template
Install dependencies:
npm install
# or
pnpm install
# or
yarn install
Start the development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
The development server will be available at http://localhost:5173
src/
āāā routes/ # SvelteKit pages and API routes
ā āāā +layout.svelte
ā āāā +page.svelte
āāā lib/ # Reusable components and utilities
ā āāā index.ts
ā āāā assets/
āāā app.html # HTML shell
āāā app.css # Global styles and TailwindCSS imports
āāā app.d.ts # Type definitions
static/ # Static assets
āāā robots.txt
āāā favicon.png
To create a production version of your app:
npm run build
You can preview the production build with:
npm run preview
To deploy your app, you may need to install an adapter for your target environment.
This template comes with TailwindCSS pre-configured. You can start using utility classes immediately:
<div class="bg-blue-500 text-white p-4 rounded-lg shadow-md">
<h1 class="text-2xl font-bold">Hello, TailwindCSS!</h1>
</div>
tailwind.config.js
to customize your design systemsrc/app.css
@apply
directive for component-based stylingCreate new routes by adding files to the src/routes/
directory:
src/routes/about/+page.svelte
ā /about
src/routes/blog/[slug]/+page.svelte
ā /blog/dynamic-slug
Store reusable components in src/lib/
and import them:
<script>
import MyComponent from '$lib/MyComponent.svelte';
</script>
@apply
directiveContributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.