Spoko Design System (SDS) is an Astro-based design system with Vue 3 components and UnoCSS for styling. It's published as spoko-design-system on npm and serves as both a documentation site and a component library.
Live documentation: https://sds.spoko.space/
The project is still in the development phase, use at your own risk ;-)
Please feel free to fork it, edit it and let me know what do you think about it.
- Node.js: >= 22.17.0
- Package Manager: pnpm >= 10.16.1 (v10.17.1 recommended)
This project serves two purposes simultaneously:
- Documentation Site: Astro-based documentation at https://sds.spoko.space/
- npm Package: Component library exportable as
spoko-design-system
Components must work in BOTH contexts - as part of the Astro site and as importable npm package components.
Install as a package:
pnpm add spoko-design-systemOr clone the repository for development:
git clone https://github.com/polo-blue/sds.git
cd sds
pnpm installpnpm dev # Start development server (runs on port 1234)
pnpm start # Alias for dev
pnpm build # Build production site
pnpm preview # Preview production build
pnpm check # Run Astro type checkingpnpm lint # Lint all source files
pnpm lint:fix # Lint and auto-fix issues
pnpm format # Format code with Prettier
pnpm format:check # Check code formattingThis project uses automated semantic-release for version management and publishing.
pnpm semantic-release # Manual release (usually automated via CI)
pnpm prepublishOnly # Runs build before publish (automatic)All commits MUST follow conventional commits format:
<type>[optional scope]: <description>
feat: New feature β MINOR version bump (0.1.0)fix: Bug fix β PATCH version bump (0.0.1)perf,refactor,style,docs: β PATCH version bumptest,ci,chore: β No release
Breaking Changes: Add BREAKING CHANGE: footer β MAJOR version bump (1.0.0)
feat(components): add Modal component with accessibility features
fix(Input): resolve floating label positioning
docs: update Button component examples
chore: update dependencies [skip ci]On merge to main, GitHub Actions automatically:
- Analyzes commits
- Determines version bump
- Updates package.json and CHANGELOG.md
- Creates GitHub release
- Publishes to npm
- β‘οΈ Vue 3, Vite, pnpm - born with fastness
- π¨ UnoCSS - the instant on-demand atomic CSS engine
- π astro-icon - for local icons, sprites and
@iconify-json/*sets - π astro-navbar - fully responsive and accessible headless navigation bar
- π astro-pagefind - Astro integration for Pagefind static site search
- π astrojs/mdx - markdown support
- π¦ Playform compression - compression utilities to your Astro project
- π² PWA - Zero-config PWA Integration for Astro
- π·οΈ astro-meta-tags - Meta Tags inside for Astro Dev Toolbar
- π¨ Static-site generation (SSG)
- π‘ Swiper - modern mobile touch slider with hardware accelerated transitions and amazing native behavior
- π View Transitions API - makes it easy to change the DOM in a single step, while creating an animated transition between the two states
- βοΈ Deploy on Netlify
The design system uses two separate but coordinated icon systems:
- Static imports for all icon JSON files
- Used via
i-{collection}-{name}classes (e.g.,i-lucide-car)
- Lists specific icons to include from each collection
- Used in Astro components via
<Icon name="collection:icon" />
The design system includes carefully curated icon collections from Iconify:
- π¨ Material Design Icons - comprehensive icon set for UI elements
- π Ant Design Icons - clean outlined icons
- π± Bootstrap Icons - simple and consistent icons
- π― Boxicons - high quality web icons
- π Carbon Icons - IBM's design language icons
- πͺ Lucide Icons - beautiful & consistent icon toolkit
- π¨ Streamline Freehand Color - hand-drawn style colored icons
- π VS Code Icons - file type and technology icons
- π’ Simple Icons - brand icons for popular services
- β‘ Fluent UI Icons - Microsoft's design system icons
See the complete list and configuration in icon.config.ts.
- Add icon name to
icon.config.tsin the appropriate collection's array - Icon is automatically available in both UnoCSS (class) and astro-icon (component)
Important: UnoCSS config is split across two locations:
- Root
uno.config.ts: Simple wrapper that imports the main config uno-config/directory: Main configuration systemuno-config/index.ts: Core config withcreateSdsConfig()functionuno-config/theme/: Theme definitions (colors, typography, breakpoints, etc.)uno-config/theme/shortcuts/: Component shortcuts organized by category
- Theme changes: Modify files in
uno-config/theme/ - Shortcut additions: Add to appropriate file in
uno-config/theme/shortcuts/ - Never edit root
uno.config.tsdirectly - The
createSdsConfig()function can be imported by consumers to extend the config
Theme files in uno-config/theme/:
colors.ts: Complete color palettetypography.ts: Font families, sizes, weightsbreakpoints.ts: Responsive breakpointsdimensions.ts: Spacing, sizing scaleseffects.ts: Shadows, borders, transitionsgrid.ts: Grid template configurationscontainer.ts: Container max-widths and padding
Feel free to add new pages to the Core section in the documentation.
Create component in appropriate location:
- Vue:
src/components/ComponentName.vue - Astro:
src/components/ComponentName.astro
Export from root index.ts (note the ./src/ prefix):
// β
Correct
export { default as ComponentName } from './src/components/ComponentName.vue';
// β Wrong
export { default as ComponentName } from './components/ComponentName.vue';Add documentation page in src/pages/components/component-name.mdx
Add to navigation in src/config.ts:
export const SIDEBAR = [
{ text: "Core", header: true },
{ text: "Introduction", link: "/core/introduction" },
// ...
{ text: "Components", header: true },
{ text: "Component Name", link: "/components/component-name/" },
];Although it's not required, you can create folders for new sections.
To show the section on the left side navigation, add it to the navigation config file at src/config.ts:
export const SIDEBAR = [
{ text: "Core", header: true },
{ text: "Introduction", link: "/core/introduction" },
// ...
{ text: "Components", header: true },
{ text: "Buttons", link: "/components/buttons" },
// ...
{ text: "New section", header: true },
{ text: "New component", link: "/new-section/new-component/" },
];To add new pages just create an .astro or .mdx file in src/pages/[section]/my-page.mdx. Remember to add it to the navigation config in src/config.ts so it shows up in the left side navigation.
You're free to organize the pages however you want.
There's a class called .component-preview that you can use to wrap your component in a grid:
<div class="component-preview">
<button class="text-white bg-blue-lightest px-4 py-2 rounded-md">Your component</button>
</div>Three main path aliases defined in tsconfig.json:
@components/*βsrc/components/*@utils/*βsrc/utils/*@types/*βsrc/types/*
The package provides multiple export paths:
import { Button, Input } from 'spoko-design-system'
import { createSdsConfig } from 'spoko-design-system/uno-config'
import { iconConfig } from 'spoko-design-system/icons'Available exports:
.: Main component exports./styles/*: Direct style imports./icons: Icon configuration./icon-collections: Icon collection list./uno-config: UnoCSS config for consumers
You can find the css for the pages in src/styles/content.css.
Documentation and live examples:
Most of the components from this repository can be seen in production:
Spoko Design System template was made in Poland by @spoko.space for personal and commercial use.
MIT