@arolariu/components
Version:
A collection of reusable components for React applications, built as ESM & CJS modules with tree shake, minify and bundler optimizations enabled, for the lowest bundle size (import cost)!
211 lines (156 loc) ⢠6.51 kB
Markdown
# ⨠@arolariu/components āØ






A collection of reusable, accessible UI components for React applications, built on top of [Radix UI](https://www.radix-ui.com/) primitives and inspired by [shadcn/ui](https://ui.shadcn.com/).
## š Table of Contents
- Features
- Installation
- Usage
- Available Components
- Component Documentation
- TypeScript Support
- Server-Side Rendering
- Browser Support
- Contributing
- License
- Author
- Acknowledgments
## š Features
- **š² Fully Tree-Shakeable** - Import only the components you need
- **š TypeScript Support** - Full type definitions for all components
- **š¦ Multiple Module Formats** - ESM, CommonJS, and UMD support
- **āæ Accessibility** - Built on Radix UI primitives with their ARIA compliance standard
- **šØ Customizable** - Override styles with Tailwind CSS and/or your styling methods
- **š Modern** - Designed for React 18+ and modern browsers
- **šŖ¶ Zero Runtime CSS** - Uses Tailwind for styling
- **š„ļø Server-Side Rendering Compatible** - Works with Next.js and other SSR frameworks
## š„ Installation
Choose your preferred package manager:
```bash
# npm
npm install @arolariu/components
# yarn
yarn add @arolariu/components
# pnpm
pnpm add @arolariu/components
```
## š§© Usage
### Basic Import
```tsx
import { Button } from "@arolariu/components/button";
import { Card, CardHeader, CardTitle
CardDescription, CardFooter
} from "@arolariu/components/card";
export default function MyComponent() {
return (
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card Description</CardDescription>
</CardHeader>
<CardFooter>
<Button>Click Me</Button>
</CardFooter>
</Card>
);
}
```
### Tree-Shaking
For optimal bundle size, import components directly:
```tsx
// ā
Good: Only imports the Button component
import { Button } from "@arolariu/components/button";
// ā Avoid: Imports all the components
import { Button } from "@arolariu/components";
```
## š§° Available Components
This library includes over 30 components, organized by category:
| Category | Components |
| ---------------- | ----------------------------------------------------------------- |
| **Layout** | `Card`, `AspectRatio`, `Separator`, `Resizable` |
| **Inputs** | `Button`, `Input`, `Textarea`, `Checkbox`, `RadioGroup`, `Select` |
| **Navigation** | `Breadcrumb`, `Tabs`, `NavigationMenu`, `Sidebar` |
| **Overlays** | `Dialog`, `Drawer`, `Sheet`, `Popover`, `Tooltip` |
| **Feedback** | `Alert`, `Progress`, `Skeleton` |
| **Data Display** | `Table`, `Calendar`, `Avatar`, `Badge` |
| **Advanced** | `Form`, `Command`, `Chart`, `Carousel` |
## š Component Documentation
Each component can be imported individually:
```tsx
// Buttons
import { Button, buttonVariants } from "@arolariu/components/button";
// Forms
import { Form } from "@arolariu/components/form";
import { Input } from "@arolariu/components/input";
// Data Display
import { Table } from "@arolariu/components/table";
import { Avatar } from "@arolariu/components/avatar";
// Overlays
import { Dialog } from "@arolariu/components/dialog";
import { Sheet } from "@arolariu/components/sheet";
```
The NPM package delivers declaration maps for each component, providing detailed documentation and prop types.
The declaration maps, coupled with source code that's available under the `src` directory makes troubleshooting and debugging components extremely easy.
## š TypeScript Support
This library includes comprehensive TypeScript definitions. All components are properly typed and have declaration maps for tight integration.
```tsx
import { Button } from "@arolariu/components/button";
import type { buttonVariants } from "@arolariu/components/button";
// TypeScript will provide autocomplete and type checking for props
const MyButton = () => {
return <Button variant={buttonVariants.primary}>Click Me</Button>;
};
```
## š„ļø Server-Side Rendering
All components are compatible with server-side rendering frameworks like Next.js, by default:
```tsx
// Next.js App Router example
import { Button } from "@arolariu/components/button";
export default async function SSR_Page() {
return (
<div>
<Button>Server Component Button</Button>
</div>
);
}
// For client interactions
import { Button } from "@arolariu/components/button";
export default function CSR_Page() {
return (
<div>
<Button>Client Component Button</Button>
</div>
);
}
```
## š Browser Support
- š Chrome/Edge (All versions starting 2018)
- š¦ Firefox (All versions starting 2018)
- š§ Safari (All versions starting 2018)
## š„ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. š“ Fork the repository
2. šæ Create your feature branch: `git checkout -b my-new-feature`
3. š¾ Commit your changes: `git commit -am 'Add some feature'`
4. š Push to the branch: `git push origin my-new-feature`
5. š Submit a pull request
## š License
[MIT](https://choosealicense.com/licenses/mit/)
## šØāš» Author
**Alexandru-Razvan Olariu**
- š Website: [https://arolariu.ro](https://arolariu.ro)
- š» GitHub: [@arolariu](https://github.com/arolariu)
- š„ LinkedIn: [Alexandru-Razvan Olariu](https://www.linkedin.com/in/olariu-alexandru/)
## š Acknowledgments
- [Radix UI](https://www.radix-ui.com/) for providing accessible primitives
- [shadcn/ui](https://ui.shadcn.com/) for inspiration and component patterns
- [Tailwind CSS](https://tailwindcss.com/) for styling utilities
- [Rollup](https://rollupjs.org/) for bundling
- [Vite](https://vitejs.dev/) for the development environment
- [TypeScript](https://www.typescriptlang.org/) for static typing
---
ā **If you find this library helpful, please consider giving it a star on GitHub!** ā