
tsconfig code
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"]
}
Learn to set up Rollup by installing seven npm modules and understand each module’s purpose for building a React UI component library.
Configure a rollup build by importing TypeScript, CommonJS, resolve, terser, peer dependencies external, and DTS plugins. Set input to src/index.ts and output in CommonJS and ESM formats, plus type definitions.
Learn to use the classnames library to apply conditional classes in a React component by passing a base string and a condition object, including a disabled state with pointer events.
Develop a React button component with an icon prop and configurable icon position using Lucid React icons, and validate styling through build, Storybook, and npm publishing workflow.
learn how to author Storybook stories for a React button component, including creating tsx stories, exporting variants with args, and wiring Tailwind CSS via postcss for accurate styling.
Develop a reusable input component with rich props (value, onChange, name, label, placeholder, disabled, type, size, rounded, error) and its Storybook stories for a React UI library.
Students learn to write input field stories in Storybook, showcasing size, disabled, and rounded variants, and adjust styling to prepare themes for a React UI component library.
Explore how to write the disabled story for the select field, apply default false, and use class names to lock options, then add size and rounded props with examples.
Welcome to the course on "Building and Publishing a UI Component Library to NPM"! Whether you're a seasoned developer or just starting out, this course is designed to equip you with the skills and knowledge needed to create, publish, and maintain your very own UI component library. We'll guide you through the entire process, from understanding the basics of component libraries to mastering tools like Rollup and Storybook, and even publishing your work to NPM. By the end of this course, you'll have not only a solid grasp of building reusable UI components but also the confidence to share your work with the world. Let's get started on this exciting journey together!
Below are the key topics we’ll be covering in this course:
Introduction to UI Component Libraries: Understand what a UI component library is and its purpose.
Integrating Rollup: Learn how to set up and configure Rollup for building your library.
Publishing to NPM: Step-by-step guide on publishing your UI components to NPM.
Testing in Consumer Apps: Test your published components in real-world applications.
Updating Published Libraries: Learn how to make and manage updates to your NPM-published libraries.
Testing with npm link: Use the npm link feature to test your components locally without publishing.
Storybook Setup: Introduction and setup of Storybook for developing and showcasing your components.
Writing Stories: Learn what a Story is and how to write Stories for your components.
Component Development: Build 10 UI components and create Stories for each.
Implementing Themes: Learn how to add theming capabilities to your UI component library.
Deploying Storybook: Guide to deploying your Storybook instance.
Access to Source Code: Full access to the complete source code of the project.