This guide covers how to add a new registry item (component, hook, or theme) to the MicroClub registry.
At this stage, our focus is explicitly on implementing remaining planned registry items (components). We ask that you prioritize these before proposing other features or architectural changes.
# Install dependencies
pnpm install
# Run development server (Next.js docs site)
pnpm run dev
# Run Storybook for component development
pnpm run storybook
# Build the registry (required before submitting PR)
pnpm run build:registry
# Format code (required before submitting PR)
pnpm run format
# Check code formatting
pnpm run format:checkWe use Conventional Commits for all commit messages. This enables automated changelog generation and semantic versioning.
<type>[optional scope]: <description>
[optional body]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that don't affect code meaning (formatting, missing semi-colons, etc.) |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
A code change that improves performance |
test |
Adding or correcting tests |
chore |
Changes to build process, dependencies, or auxiliary tools |
ci |
Changes to CI configuration files and scripts |
Add ! after type/scope or include BREAKING CHANGE: in footer:
feat!: remove legacy API
BREAKING CHANGE: The old API endpoint has been removed.
git commit -m "feat: add mc-button component"
git commit -m "fix: resolve input focus issue"
git commit -m "docs: update mc-button documentation"
git commit -m "refactor: simplify button styles"# First, run the dev server
pnpm run dev
# In another terminal, test CLI commands
pnpm cli:dev init primary
pnpm cli:dev add mc-button
pnpm cli:dev list- Internal Contributors: You have push access to the repository.
- External Contributors: You are an open-source contributor. Fork the repository first, then follow the external guide.
If you have push access to the repository, follow these steps.
- Find an issue labeled with
componentthat includes a Figma link - Create a branch from
dev(naming:component/mc-<name>) - Implement the item (e.g., component using
@base-ui/reactprimitives) - Create stories, examples, and documentation
- Test with Storybook and verify registry build (
pnpm run build:registry) - Create a pull request targeting
dev
Browse the GitHub issues to find an item to implement. Each issue includes a Figma link with the design specifications. Please stick to these designs to maintain MicroClub's identity.
git switch dev
git pull origin dev
git switch -c component/mc-<name>Example: git switch -c component/mc-button
Create your component file in packages/web/registry/ui/mc-<name>.tsx.
- Prefix with
mc-(e.g.,mc-button.tsx) - Use
@base-ui/reactprimitives for high-quality, accessible building blocks - Utilize Tailwind CSS v4 for styling
Example file: packages/web/registry/ui/mc-button.tsx
Edit packages/web/registry/registry-ui.ts and add your entry. This metadata allows the shadcn-based CLI to discover and distribute your code.
Edit packages/web/registry/registry-examples.ts and add your example to the examples array. This links the demo to the registry.
Create a demo for the documentation in packages/web/registry/examples/mc-<name>-demo.tsx.
Example file: packages/web/registry/examples/mc-button-demo.tsx
Create a story in packages/web/stories/Mc<Name>.stories.tsx for visual testing and regression checks.
Example file: packages/web/stories/McButton.stories.tsx
Create an MDX file in packages/web/content/docs/components/mc-<name>.mdx using Fumadocs components.
Example file: packages/web/content/docs/components/mc-button.mdx
Build and test:
# Build the registry metadata (registry.json)
pnpm run build:registry
# Run storybook for visual verification
pnpm run storybookgit add .
git commit -m "feat: add mc-<name> component"
git push -u origin component/mc-<name>Create a PR targeting dev. Link the issue (e.g., Closes #42) in your description.
External contributors should follow the same technical steps but start with a fork.
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/mcoli-ui.git - Add upstream:
git remote add upstream https://github.com/MicroClub-USTHB/mcoli-ui.git - Follow the Internal Contributors steps from Step 2 onwards, using
upstreamto pull.
When adding a new item, you will create/edit these files:
| File | Purpose |
|---|---|
packages/web/registry/ui/mc-<name>.tsx |
The actual code to distribute |
packages/web/registry/registry-ui.ts |
Metadata for CLI discovery |
packages/web/registry/registry-examples.ts |
Links demos to registry |
packages/web/registry/examples/mc-<name>-demo.tsx |
Live demo for documentation |
packages/web/stories/Mc<Name>.stories.tsx |
Visual testing in Storybook |
packages/web/content/docs/components/mc-<name>.mdx |
Markdown documentation |
| Component | Design State | Dev State |
|---|---|---|
mc-button |
✅ | ✅ |
mc-input |
✅ | |
mc-textarea |
✅ | |
mc-input-otp |
✅ | ✅ |
mc-checkbox |
✅ | ✅ |
mc-radio-group |
✅ | |
mc-card |
✅ | |
mc-select |
✅ | |
mc-combobox |
✅ | |
mc-switch |
✅ | |
mc-navigation-menu |
✅ | |
mc-sidebar |
✅ | |
mc-tabs |
✅ | |
mc-breadcrumb |
✅ | |
mc-pagination |
✅ | |
mc-dialog |
||
mc-alert-dialog |
||
mc-alert |
||
mc-sonner |
||
mc-tooltip |
||
mc-popover |
||
mc-dropdown-menu |
||
mc-context-menu |
||
mc-data-table |
||
mc-accordion |
||
mc-collapsible |
||
mc-separator |
||
mc-progress |
||
mc-calendar |
||
mc-scrollarea |
||
mc-skeleton |
||
mc-badge |
||
mc-tag |
||
mc-avatar |
||
mc-drawer |
||
mc-hover-card |
||
mc-slider |
||
mc-carousel |
- Format Before Committing: Always run
pnpm run formatbefore committing your changes. - Distribution First: Remember that this code will be copied into user's projects. Keep it clean and self-contained.
- Figma First: Always refer to the designs in Figma for colors, spacing, and variants.
- Prefix Everything: All registry items MUST use the
mc-prefix. - Base UI: Use
@base-ui/reactfor underlying logic to ensure accessibility. - Themes and Modes: Every item must be tested in all 5 themes in both light and dark modes.
- Build Verification: Ensure
pnpm run build:registrypasses before submitting.