Thanks for your interest in contributing to shadcn-extras! 🎉
This library provides reusable animated UI components (React + Motion + Tailwind) with copy-paste and CLI install. Contributions of all kinds are welcome—components, docs, fixes, or tooling.
If you need help, reach out to @nayan_radadiya6.
- Project Structure
- Prerequisites
- Local Setup
- Key Commands
- Conventional Commits
- Adding a New Component
- Code Style & Quality
- Pull Requests
- Releases & Publishing (Maintainers)
- Requests for New Components
app/ # Next.js app (docs site)
docs/ # Docs pages + examples
components/
core/ # Reusable library components (what users install)
ui/ # Site-only UI (docs scaffolding)
website/ # Docs-only components (code blocks, previews, layout)
public/
c/ # Registry JSON for components (CLI uses this)
e/ # Registry JSON for examples/snippets
cli/ # (optional) CLI code if we publish one
scripts/ # registry build scripts
lib/ # shared utils (e.g., cn, shiki helpers)
- Node.js 18+
- npm (or pnpm/yarn if you prefer)
- Basic familiarity with React, Tailwind, and Motion
# 1) Fork the repo on GitHub
# 2) Clone your fork
git clone https://github.com/nayanrdeveloper/shadcn-extras.git
cd shadcn-extras
# 3) Create a feature branch
git checkout -b feat/my-new-branch
# 4) Install dependencies
npm install
# 5) Run the docs locally
npm run dev
# open http://localhost:3000# run the docs app in dev mode
npm run dev
# format everything with Prettier + Tailwind class sorting
npm run format
# check formatting only
npm run check-format
# lint (ESLint + TypeScript)
npm run lint
npm run lint:fix
# build docs (Next.js)
npm run build
# build the registry JSON (used by CLI + docs)
npm run build:registryUse the following format for commit messages:
type(scope): short description
Types:
feat: new component or featurefix: bug fixrefactor: code change that doesn’t add features or fix bugsdocs: documentation changesbuild: dependency or build changestest: add/change testsci: CI/Actions configurationchore: repo maintenance
Examples:
feat(kpi-card): add tone and size propsfix(accordion): correct collapsed opacity variantdocs(spinners): add slow blue variant example
Create your component in components/core/my-component.tsx.
- Export a main component and subcomponents (if needed).
- Accept
classNameand merge with Tailwind viacn. - Use TypeScript,
forwardRef, and allow animations to be configurable. - Keep SRP (Single Responsibility Principle).
Create under app/docs/my-component/:
page.mdx
my-component-basic.tsx
my-component-variant.tsx
Use <ComponentCodePreview /> to show examples.
Edit scripts/registry-examples.ts:
{
name: 'my-component-basic',
path: path.join(__dirname, '../app/docs/my-component/my-component-basic.tsx'),
description: 'Basic usage of MyComponent.',
componentName: 'my-component-basic',
files: [
{
name: 'my-component.tsx',
path: path.join(__dirname, '../components/core/my-component.tsx'),
type: 'registry:ui',
},
],
},-
scripts/registry-components.ts{ name: 'my-component', path: path.join(__dirname, '../components/core/my-component.tsx'), dependencies: ['motion'], description: 'Short description for registry.', },
-
public/c/registry.json+ per-component JSON inpublic/c/if needed.
{
"name": "my-component",
"type": "registry:ui",
"title": "My Component",
"description": "Short docs description.",
"dependencies": ["motion"],
"files": [
{ "path": "components/core/my-component.tsx", "type": "registry:component" }
],
"categories": ["ui", "shadcn-extras"]
}Update app/docs/navigation.ts:
{
name: 'My Component',
href: '/docs/my-component',
isNew: true
},npm run build:registryCommit generated changes.
npx shadcn-extras add my-component- Prettier for formatting (
npm run format) - ESLint for linting (
npm run lint) - TypeScript strict
- Accessibility first (aria attributes)
- Props: accept
className, expose sensible defaults
Before opening a PR, ensure:
- Component in
components/core/ - Docs in
app/docs/<component>/ - Navigation updated
- Registry updated (
scripts/registry-*.ts+public/c/*.json) -
npm run format&npm run lintpass
# bump version
npm version patch|minor|major
# publish (ensure package.json is public)
npm publish --access publicDocs deploy via GitHub Pages (Actions).
Open a GitHub Discussion or Issue with:
- Short description & use case
- Screenshot or reference
- Motion/Tailwind constraints
🙌 Thanks for helping make shadcn-extras better for everyone!