1.0.3 ⢠Published 8 months ago
@jmau949/generic-shadcn-components v1.0.3
š¦ 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-componentsAdd a new component using ShadCN CLI:
npx shadcn-ui@latest add [component-name]Example:
npx shadcn-ui@latest add textareaCommit and push the new component:
git add .
git commit -m "Added ShadCN component: [component-name]"
git push origin mainPublish the updated package (see below).
š¢ Publishing a New Version to npm
Ensure you are logged into npm:
npm loginBump the version in package.json (e.g., from 1.0.0 to 1.0.1):
npm version patchPublish to npm:
npm publish --access publicUpdate 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.