A clean, accessible component library for SvelteKit projects.
clamp()
-based spacing and typographyButton
, Card
, Section
).d.ts
files via vite-plugin-dts
git clone https://github.com/aftongauntlett/sveltekit-components.git
cd sveltekit-components
npm install
npm run build
This generates a clean dist/
folder with index.js
, index.cjs
, and index.d.ts
.
This project uses a modern HSL-based theme system for consistent color theming across projects. Because HSL values aren’t directly editable in the VSCode color picker, this repo includes a color-preview.css
file with HEX equivalents, then syncs to real HSL-based CSS variables via a helper script.
color-preview.css
theme.css
with equivalent HSL valuesvar(--color-...)
HSL variablesManual sync:
npm run sync-theme
Watch mode (auto-sync on save):
npm run watch-theme
src/
components/
Button.svelte
theme.css # Real CSS variable theme
app.css # Tailwind + theme imports
index.ts # Export entry for build
This is a reusable, themable component library built to be consumed by SvelteKit projects. To use it locally:
In your consuming app:
pnpm link ../sveltekit-components
Or install via GitHub in package.json
:
"dependencies": {
"sveltekit-components": "github:aftongauntlett/sveltekit-components"
}
Import like:
import { Button } from "sveltekit-components";
MIT License
Copyright (c) 2025 Afton Gauntlett
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.