1.0.3 • Published 8 months ago

@jmau949/generic-shadcn-components v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

šŸ“¦ Generic ShadCN Components

A reusable ShadCN component library built with React, TypeScript, and TailwindCSS for Lenscribe and other projects.


šŸš€ Installation

To use this component library in your project, install it via npm:

npm install @jmau949/generic-shadcn-components

šŸ“Œ Usage

Import and use the components in your React project:

import { Button, Input, Card } from "@jmau949/generic-shadcn-components";

export function ExampleComponent() {
  return (
    <Card>
      <Input placeholder="Enter text here" />
      <Button>Click Me</Button>
    </Card>
  );
}

šŸ› ļø Adding New ShadCN Components

To add a new component to the library:

Navigate to the repo:

cd generic-shadcn-components

Add a new component using ShadCN CLI:

npx shadcn-ui@latest add [component-name]

Example:

npx shadcn-ui@latest add textarea

Commit and push the new component:

git add .
git commit -m "Added ShadCN component: [component-name]"
git push origin main

Publish the updated package (see below).

šŸ“¢ Publishing a New Version to npm

Ensure you are logged into npm:

npm login

Bump the version in package.json (e.g., from 1.0.0 to 1.0.1):

npm version patch

Publish to npm:

npm publish --access public

Update the package in consuming projects:

npm update @jmau949/generic-shadcn-components

šŸŽÆ Project Structure

generic-shadcn-components/
│── components/
│   ā”œā”€ā”€ ui/
│   │   ā”œā”€ā”€ button.tsx
│   │   ā”œā”€ā”€ input.tsx
│   │   ā”œā”€ā”€ card.tsx
│── src/
│   ā”œā”€ā”€ index.css
│── dist/ (Generated build files)
│── .gitignore
│── index.ts (Exports all components)
│── package.json
│── postcss.config.cjs
│── tailwind.config.ts
│── tsconfig.json
│── vite.config.ts
│── README.md (You are here)

šŸ“œ License

This project is licensed under the MIT License.