A modern, accessible React component library and documentation built by Arya Labs, powered by Turborepo, shadcn/ui, and Storybook.
This monorepo contains our design system implementation and documentation, powered by:
- 🏎 Turborepo — High-performance monorepo build system
- 🎨 shadcn/ui — Re-usable components built using Radix UI and Tailwind CSS
- 📖 Storybook — UI component documentation and testing
- ⚛️ React — UI component library
- 🛠 TypeScript — Type safety
- 📦 Changesets — Version management and changelogs
.
├── apps/
│ └── docs/ # Storybook documentation site
│ ├── stories/ # Component stories
│ └── .storybook/ # Storybook configuration
│
├── packages/
│ ├── ui/ # Core React components
│ │ ├── src/
│ │ │ ├── components/
│ │ │ │ ├── primitives/ # Base shadcn/Radix components
│ │ │ │ ├── composed/ # Higher-order components
│ │ │ │ └── patterns/ # Common UI patterns/layouts
│ │ │ ├── hooks/ # Shared hooks
│ │ │ ├── utils/ # Utility functions
│ │ │ ├── styles/ # Global styles
│ │ │ └── types/ # Shared TypeScript types
│ │ └── dist/ # Compiled output
│ │
│ ├── typescript-config/ # Shared TypeScript configs
│ └── eslint-config/ # Shared ESLint configs
Each package and app is 100% TypeScript. We use pnpm workspaces to manage the monorepo, which enables dependency hoisting for better performance and smaller node_modules.
Our UI library is organized into three main categories:
-
Primitives (
/primitives
)- Base components built on shadcn/ui and Radix UI
- Fully accessible and customizable
- Examples: Button, Input, Dialog, Select
-
Composed Components (
/composed
)- Higher-order components combining multiple primitives
- Pre-configured for common use cases
- Examples: SearchInput, FormField, DataTable
-
UI Patterns (
/patterns
)- Full-featured layout patterns and templates
- Reusable UI solutions for common scenarios
- Examples: AuthForm, DashboardLayout, SettingsPage
- Node.js (v22.0.0 or higher)
- pnpm (recommended package manager)
- Install dependencies:
pnpm install
- Start the development environment:
pnpm dev
This will:
- Start Storybook at
http://localhost:6006
- Watch for changes in the UI components
pnpm build
- Build all packages and appspnpm dev
- Start development environmentpnpm lint
- Lint all packagespnpm format
- Format all filespnpm clean
- Clean up allnode_modules
anddist
folders
- Root dependencies:
pnpm add -w <package>
- Package-specific:
pnpm add <package> --filter <target-package>
Run pnpm build
to confirm compilation is working correctly. You should see a folder ui/dist
which contains the compiled output.
- Compiles TypeScript and React code to ESM format
- Creates TypeScript declaration files
- Handles external dependencies appropriately
Components are exported individually for better tree-shaking. The package.json
for @arya.sh/ui
specifies exports:
{
"name": "@arya.sh/ui",
"type": "module",
"exports": {
"./primitives/*": {
"types": "./dist/components/primitives/*.d.ts",
"import": "./dist/components/primitives/*.mjs"
},
"./composed/*": {
"types": "./dist/components/composed/*.d.ts",
"import": "./dist/components/composed/*.mjs"
},
"./patterns/*": {
"types": "./dist/components/patterns/*.d.ts",
"import": "./dist/components/patterns/*.mjs"
},
"./hooks/*": {
"types": "./dist/hooks/*.d.ts",
"import": "./dist/hooks/*.mjs"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"import": "./dist/utils/index.mjs"
}
}
}
Storybook provides us with an interactive UI playground for our components. This allows us to preview our components in the browser and instantly see changes when developing locally. This example preconfigures Storybook to:
- Use Vite to bundle stories instantly (in milliseconds)
- Automatically find any stories inside the
stories/
folder - Support using module path aliases like
@arya.sh/ui
for imports - Write MDX for component documentation pages
We use Changesets for version management:
- Create a changeset:
pnpm changeset
-
Follow the prompts to:
- Select changed packages
- Choose version bump type
- Write change descriptions
-
Commit the generated changeset file
Packages are published automatically through GitHub Actions when changes are merged to main:
- Changesets bot creates a PR with version updates
- PR is reviewed and merged
- GitHub Action publishes to npm
- Fork the repository
- Create a new branch
- Make your changes
- Create a changeset (
pnpm changeset
) - Submit a pull request
- Start development server:
pnpm dev
- Make changes to components in
packages/ui/src
- View changes in Storybook
- Add/update stories in
apps/docs/stories
- Create a changeset for your changes
- ESLint and Prettier are configured
- Run
pnpm lint
to check for issues - Run
pnpm format
to format code
MIT © [Arya Labs]