A modern, feature-rich starter kit for building React component libraries with TypeScript, Storybook, and TailwindCSS.
- React 19: Latest React version with improved performance
- TypeScript: For type safety and better developer experience
- Storybook 8: Component documentation and development environment
- TailwindCSS: Utility-first CSS framework
- Vitest: Fast test runner compatible with Jest
- Tsup: Performant bundler built on top of esbuild
- ESLint/TypeScript: Code quality and consistency
- Node.js (v18+ recommended)
- pnpm (v10.5.2+ recommended)
# Clone the repository
git clone https://github.com/Mutesa-Cedric/ui-library-starter.git
cd ui-library-starter
# Install dependencies
pnpm install
Start the development server with auto-reloading:
pnpm dev
Run Storybook for component development:
pnpm storybook
Storybook will be available at http://localhost:6006
Components are organized in the src/components directory using Atomic Design principles:
/atoms
- Basic building blocks (buttons, inputs, etc.)/molecules
- Combinations of atoms (form fields, etc.)/organisms
- Complex UI sections
- Create a new directory with your component name
- Add the following files:
component-name.tsx
- Component implementationcomponent-name.test.tsx
- Testscomponent-name.stories.tsx
- Storybook documentation
- Export your component in the nearest index.ts file
Example component structure:
src/components/atoms/
└── button/
├── button.tsx
├── button.test.tsx
├── button.stories.tsx
└── index.ts
Run tests with:
# Run tests once
pnpm test
# Run tests in watch mode
pnpm test --watch
Build the library for distribution:
pnpm build
This creates optimized output in the dist
directory.
To publish a new version:
- Update the version in package.json
- Run the release script:
pnpm release
This will:
- Bump the version using bumpp
- Build the library
- Publish to npm
Component documentation is automatically generated from Storybook. Build the static Storybook site:
pnpm build-storybook
ui-library-starter/
├── .storybook/ # Storybook configuration
├── src/
│ ├── components/ # UI components
│ │ ├── atoms/ # Basic components
│ │ ├── molecules/ # Composite components
│ │ └── organisms/ # Complex UI sections
│ ├── lib/ # Utilities and helpers
│ └── index.ts # Main entry point
├── dist/ # Build output (generated)
├── README.md # Project documentation
└── package.json # Project configuration
This project is licensed under the MIT License - see the LICENSE.md file for details.