create-elses-react-ui-lib-starter
v1.0.7
Published
CLI to scaffold a React UI library starter
Maintainers
Readme
create-elses-react-ui-lib-starter
Usage
npm create elses-react-ui-lib-starter
# or
npx create-elses-react-ui-lib-starterA CLI tool to quickly scaffold a modern React UI library starter.
This starter helps developers create reusable component libraries, design systems, or shared UI packages without spending hours configuring project structure, build tools, and styling systems.
Instead of manually setting up TypeScript, exports, theming, and styling pipelines, this CLI generates a clean, ready-to-extend foundation in seconds.
Author
Portfolio: Groot
Why This Exists
Creating a React UI library often requires repetitive setup such as:
- configuring TypeScript
- structuring component exports
- handling styles inside the package
- creating a theme/token system
- ensuring the library bundles correctly for npm
Many templates available online are either:
- overly complex
- too opinionated
- or too minimal to scale
This starter aims to provide a balanced foundation:
- minimal but structured
- flexible but scalable
- ready for real-world UI libraries
What This Starter Includes
The generated project comes with a clean architecture designed for building UI libraries.
React + TypeScript
Strong typing for components and props from the start.
Tailwind CSS v4
Tailwind is preconfigured and compiled into the library bundle so users do not need to import CSS manually.
Token-Based Theming System
A simple theme system using tokens and context.
Supports things like:
- light mode
- dark mode
- customizable theme tokens
Modular Component Structure
Each component follows a scalable folder pattern.
components/
Button/
Button.tsx
index.ts
This keeps imports clean and makes scaling the library easier.
Central Export System
All components are exported through a single entry file.
src/index.ts
This ensures consumers can import components easily.
Who This Starter Is For
This starter is ideal for developers who want to build:
- personal component libraries
- reusable UI packages
- internal design systems
- npm UI component libraries
- shared components across multiple projects
If you want to publish your own UI package to npm, this starter provides a solid base.
Installation
Run the CLI with:
npx create-elses-react-ui-lib-starterThe CLI will ask for some basic information.
Example prompts:
package name
version
description
authorOnce completed, your project folder will be generated automatically.
Getting Started
After the project is created:
1. Navigate into the project
cd your-library-name2. Install dependencies
npm install3. Build the library
npm run buildThe build output will be generated inside the dist folder.
Basic Usage Example
After publishing your library, it can be used like this:
import { Theme, Button } from "your-library";
function App() {
return (
<Theme mode="light">
<Button variant="solid">Hello</Button>
</Theme>
);
}The Theme provider supplies tokens used by the components.
Project Philosophy
This starter follows a few simple principles:
Keep things simple
Avoid unnecessary complexity while maintaining a scalable structure.
Encourage modular components
Each component should live inside its own folder.
Bundle styles automatically
Consumers should not need to import CSS manually.
Make publishing easy
The generated project is already structured for npm publishing.
When To Use This Starter
Use this starter if you want to:
- build your own React component library
- create reusable UI components across projects
- publish a UI package to npm
- experiment with design system architecture
License
MIT
