@tailscale/spellbook
v0.0.38
Published
Spellbook design system used by Tailscale web projects. Not maintained for external use.
Keywords
Readme
Spellbook
Spellbook design system used by Tailscale web projects. Not maintained for external use.
Development Setup
Prerequisites
Ensure you have the following tools installed:
- Node.js 22.14.0 (use
nvmto manage Node versions)nvm use 22.14.0 - Yarn 1.22.19 (package manager)
npm install -g [email protected]
Getting Started
Clone the repository
git clone https://github.com/tailscale/spellbook.git cd spellbookInstall dependencies
yarn installStart Storybook for development
yarn storybookThis will start Storybook on
http://localhost:6006(or the next available port)
Available Scripts
yarn storybook- Start Storybook development serveryarn build-storybook- Build Storybook for productionyarn build- Build the component library for productionyarn test- Run tests with Vitest
Environment Compatibility
This project has been tested and works with:
- Node.js 22.14.0 (recommended for team consistency)
Package Management
This project uses Yarn v1 as the package manager. The yarn.lock file should be committed, and package-lock.json should be ignored/removed if present.
Repo Structure:
spellbook/
├── src/
│ ├── components/
│ │ ├── button/
│ │ │ ├── button.tsx
│ │ │ ├── button.stories.tsx
│ │ ├── ...
│ ├── assets/
│ │ ├── fonts/
│ │ └── images/
│ ├── hooks/
│ ├── utils/
│ ├── tailwind.css
│ └── index.ts # barrel file for listing official exports of the libraryComponent Development
Components are located in src/components/ and follow these patterns:
- OSS-ready structure with proper style mappings
- Comprehensive TypeScript types and exported constants
- Accessibility features with proper ARIA attributes
- Storybook stories for documentation and testing
Example component structure:
src/components/button/
├── button.tsx # Main component
├── button.stories.tsx # Storybook stories
├── button.md # Description markdown (optional)Styling Guidelines
- Use the
.button,.input, and other base CSS classes fromsrc/tailwind.css - Follow the established design tokens and color system
- Ensure components have rounded corners and consistent spacing
- Support both light and dark themes
Contributing
When adding or modifying components:
- Ensure TypeScript strict mode compliance
- Add comprehensive Storybook stories
- Include proper accessibility attributes
- Follow the established component patterns
- Export components from
src/index.ts
Troubleshooting
Node.js Version Issues: If you encounter build errors, ensure you're using Node.js 22.14.0:
node --version # Should output v22.14.0Package Manager Issues: If dependencies fail to install, try:
rm -rf node_modules yarn.lock
yarn install