A modern, extensible design system for building consistent, accessible user interfaces.
- Nimbus Design System
Nimbus is a comprehensive design system that provides a collection of reusable components, icons, and design tokens for building consistent user interfaces. This monorepo contains multiple packages and applications that work together to provide a cohesive design system experience.
Package | Description | Purpose |
---|---|---|
@commercetools/nimbus | Core UI component library | Provides React components for building user interfaces |
@commercetools/nimbus-icons | Icon library | SVG files wrapped as React components |
tokens | Design tokens | Color, spacing, typography, and other design variables |
color-tokens | Brand colors | Brand-specific color definitions |
Application | Description | Purpose |
---|---|---|
docs | Documentation site | Interactive documentation for all Nimbus packages, auto-generated from MDX files in the packages |
Before you begin, ensure you have the following installed:
- Node.js: v22.14.0+
- PNPM: v9.12.3+
All commands should be run from the repository root.
-
Clone the repository:
git clone https://github.com/your-org/nimbus.git cd nimbus
-
Initialize the repository:
pnpm nimbus:init
Tip
It is advisable to run the repo:init
command after every branch-switch. The
command gets rid of all node_modules
- & dist
-folders, reinstalls
dependencies and rebuilds all packages.
Start the development environment with the following command:
pnpm start
This will start both the documentation app and Storybook in parallel:
- Documentation app: http://localhost:5173/
- Storybook: http://localhost:6006/
If you prefer to run just one of the applications:
# Start only the documentation app
pnpm start:docs
# Start only Storybook
pnpm start:storybook
Build all packages and applications:
pnpm build
Build only specific parts of the system:
# Build only the packages (not the docs application)
pnpm build:packages
# Build only the documentation application
pnpm build:docs
# Build only the design tokens
pnpm build:tokens
Nimbus provides a scaffolding tool to generate new component templates:
pnpm component:new
This interactive command will:
- Prompt you for the component name
- Generate all necessary files with appropriate templates
- Set up the component structure following our best practices
The generated files include:
- Component implementation
- TypeScript types
- Documentation (MDX)
- Story files for visual testing
- Index exports
To initialize or reset the entire project:
# Full initialization (reset, install dependencies, build)
pnpm nimbus:init
# Reset only (remove node_modules and dist folders)
pnpm nimbus:reset
Generate design tokens for the system:
pnpm generate:tokens
This command processes the token source files and outputs them in multiple formats:
- CSS custom properties
- TypeScript definitions
- Component-specific token files
Want to test your local Nimbus code changes in another repo (like Merchant
Center) before publishing? pnpm link --global
lets you do this by creating a
direct connection (a symlink) between your local Nimbus and the other repo.
Follow these steps:
-
Build Nimbus: Make sure Nimbus and its internal packages have been built recently with your latest changes. (Via
pnpm build
command in the Nimbus repo). -
Register Nimbus Locally: In your Nimbus design system repository (at the root folder), run:
pnpm link --global
- What this does: This tells your computer where your local Nimbus code
lives and registers it globally under its package name (
nimbus
). Think of it like a temporary, local "publishing" step just for your machine.
- What this does: This tells your computer where your local Nimbus code
lives and registers it globally under its package name (
-
Connect Your Project to Local Nimbus: In the target repository where you want to use your local Nimbus (such as Merchant Center), run:
pnpm link --global nimbus
- Important: You'll need to run this command within the application you
want to use it in rather than at the root level - for example, in the
application-project-settings
directory in the Merchant Center repo. - What this does: This connects this specific project to the local
Nimbus you just registered. It creates a special link (symlink) inside
this project's
node_modules
folder that points directly to your local Nimbus code. - Verification: You can peek inside the target repo's
node_modules
folder; you should seenimbus
listed (often visually indicated as a link).
- Important: You'll need to run this command within the application you
want to use it in rather than at the root level - for example, in the
-
Import and Use: Now, in your target repo's code, you can import and use Nimbus components.
// Correct way to import after linking:
import {
Box,
Avatar,
NimbusProvider,
Button,
LoadingSpinner,
} from '../../../node_modules/nimbus/packages/nimbus'; // <-- This is a relative path to the symlink - you'll have to adjust the depth as needed.
// Use the components...
function MyComponent() {
return (
<NimbusProvider>
<Box>
<Button>Hello Nimbus!</Button>
</Box>
</NimbusProvider>
);
}
```
5. **Testing changes**: Make changes to your local Nimbus code, then run
`pnpm build` in Nimbus to rebuild. You should now see changes reflected in
the target repo.
6. **Unlink when finished**:
```bash
# In the target project:
pnpm unlink -g nimbus
# In the Nimbus repository:
pnpm unlink --global
We welcome contributions from all team members. To contribute:
- Create a new branch for your feature or fix
- Make your changes
- Write or update tests
- Update documentation
- Submit a pull request
Please follow our coding standards and commit message conventions.
Problem | Solution |
---|---|
Component styles not updating | Make sure you've rebuilt the tokens with pnpm build:tokens |
Documentation site not showing latest changes | Restart the development server with pnpm start |
Build errors after pulling latest changes | Try running pnpm nimbus:init to reset, reinstall, and rebuild |
For additional help, please contact the Nimbus team or submit an issue in our repository.