@base-xui/react-xui v0.2.1
React XUI Component Library
A modern React component library built with Vite, TypeScript, and Tailwind CSS.
Installation
npm install react-xui
# or
yarn add react-xui
# or
pnpm add react-xuiUsage
import { Button } from "react-xui";
function App() {
return <Button variant="primary">Click me</Button>;
}Local Development
Building the Package
To build the library locally:
pnpm build:packageTesting Locally with yalc
For testing the package in another local project without publishing to npm:
Install yalc globally (if not already installed):
npm install -g yalc # or pnpm install -g yalcBuild and publish the package locally:
# In react-xui directory pnpm build:package yalc publishIn your test application:
# In your test app directory yalc add react-xui npm install # or pnpm installWhen you make changes to the library:
# In react-xui directory pnpm build:package yalc pushOr use watch mode for continuous updates:
pnpm build:watchAnd in another terminal:
yalc push --watchTo remove the yalc link:
# In your test app directory yalc remove react-xui npm install # or pnpm install
Development
Available Scripts
pnpm storybook- Start Storybook for component developmentpnpm build:storybook- Build Storybook for deploymentpnpm test- Run testspnpm lint- Lint codepnpm format- Format codepnpm build:watch- Build in watch mode for development
Project Structure
lib/src/- Component source codelib/src/components/- UI componentslib/src/utils/- Utility functionslib/tests/- Test utilities
Contributing
Development Workflow
Create a new branch from
development:git checkout development git pull git checkout -b feature/my-featureMake your changes and commit them using conventional commits:
git commit -m "feat: add new button variant"Add a changeset to document your changes:
pnpm changeset- This will prompt you to:
- Select which packages to include in the changeset
- Choose the type of change (major, minor, patch)
- Write a summary of the changes
- This will prompt you to:
Commit the generated changeset file:
git add .changeset/*.md git commit -m "chore: add changeset"Push your branch and create a PR against the
developmentbranch:git push -u origin feature/my-feature
Release Process
When changes are merged to the main branch:
- The CI workflow will run tests and build the package
- The release workflow will:
- Version the packages based on changesets
- Update changelogs
- Publish the package to npm
If there are changesets on the development branch, when you merge to main:
- A release PR will be created automatically
- Merging this PR will trigger the version bump and publish
Working with Changesets
pnpm changeset- Create a new changesetpnpm version-packages- Bump versions and update changelogs locallypnpm release- Publish packages to npm (only runs in CI)