- NodeJS
- Either npm (comes with node) or pnpm
Why we recommend using pnpm? See: https://pnpm.io/motivation
On Windows, use PowerShell Invoke-WebRequest https://get.pnpm.io/install.ps1 -UseBasicParsing | Invoke-Expression
On Linux/Mac, use curl -fsSL https://get.pnpm.io/install.sh | sh -
- Install dependencies:
pnpm install - Start Storybook:
pnpm run storybook - Open http://localhost:6006 to see components
- Main Button Component:
src/components/ui/scdh/button.tsx - Global Fonts & Colors:
src/styles.css - Tailwind Config:
tailwind.config.js
Colors: Add custom colors in tailwind.config.js:
colors: {'scdh-blue': 'rgba(159, 210, 237, 1)','scdh-dark': '#333333'}Button Styling: Modify classes in button.tsx:
// SCDH brand colors for default variantvariant==='default'&&["bg-scdh-blue text-black",// Background & text color"hover:bg-scdh-blue/80",// Hover state"rounded-lg",// Border radius (8px)]| Type | styles.css | preview.css |
|---|---|---|
| Tailwind directives | ✅ | ❌ |
| Font definitions | ✅ | ❌ |
| CSS custom properties | ✅ | ❌ |
| Component base styles | ✅ | ❌ |
| Storybook canvas styling | ❌ | ✅ |
| Link/heading styles | ❌ | ✅ |
| Body layout | ❌ | ✅ |
| Dark mode (preview) | ❌ | ✅ |
// Consumer's appimport'@scdh/ui-components/styles.css';import{Button,TreeView}from'@scdh/ui-components';functionApp(){return<Button>Click me</Button>;}