weloop-shadcn-ui
Version:
WeLoop UI component library with Radix UI and Recharts
293 lines (224 loc) ⢠7.72 kB
Markdown
# WeLoop ShadCN UI
A beautiful and accessible UI component library built with React, TypeScript, and SCSS.
[](https://www.npmjs.com/package/weloop-shadcn-ui)
[](https://github.com/your-username/weloop-shadcn-ui/blob/main/LICENSE)
## š Quick Start
### 1. Install
```bash
# React 18
npm install weloop-shadcn-ui@^1.1.8 react@^18 react-dom@^18
# (Only if you use forms)
npm install react-hook-form@^7 @hookform/resolvers@^3
# React 19
npm install weloop-shadcn-ui@^1.1.8 react@^19 react-dom@^19
# (Only if you use forms)
npm install react-hook-form@^8 @hookform/resolvers@^4
```
### 2. Import Styles
Add this to your main CSS file (e.g., `src/index.css` or `src/App.css`):
```css
@import "weloop-shadcn-ui/styles";
```
### 3. Import Components
```tsx
import {
Button,
Card,
CardContent,
CardHeader,
CardTitle,
} from "weloop-shadcn-ui";
```
### 4. Use Components
```tsx
import {
Button,
Card,
CardContent,
CardHeader,
CardTitle,
} from "weloop-shadcn-ui";
function App() {
return (
<div className="wl-container">
<Card>
<CardHeader>
<CardTitle>Welcome to WeLoop ShadCN UI</CardTitle>
</CardHeader>
<CardContent>
<Button>Click me</Button>
</CardContent>
</Card>
</div>
);
}
```
## ā ļø Notes on React 19
- The core library builds and installs on React 19.
- Some form-related components rely on `react-hook-form`. It is not a peer; install it only if you use forms.
- Install `react-hook-form` and `@hookform/resolvers` with versions compatible to your React version (see commands above).
## šÆ Features
- āļø **React 18ā19** - Tested install on React 18 and 19
- šØ **Beautiful Design** - Modern, accessible components
- š **Dark Mode** - Built-in dark mode support
- š± **Responsive** - Mobile-first design approach
- āæ **Accessible** - WCAG compliant components
- šÆ **TypeScript** - Full type safety
- šØ **Customizable** - Easy theming with CSS variables
- š¦ **Zero Setup** - No additional dependencies required
- š **Optimized** - Tree-shaking friendly with clean exports
- šØ **SCSS-based Styling** - Consistent design with SCSS classes
- š§ **Pure SCSS** - No external styling dependencies
- š **Chart Components** - Built-in Recharts integration
- šÆ **Form Handling** - React Hook Form integration
- šØ **Icon Support** - Lucide React icons included
## š§© Available Components
### Layout & Structure
- `Accordion` - Collapsible content sections
- `AppBar` - Application header with navigation
- `AspectRatio` - Maintain aspect ratio for content
- `Badge` - Status indicators and labels
- `Banner` - Prominent notification banners
- `Breadcrumb` - Navigation breadcrumbs
- `Button` - Interactive buttons with variants
- `ButtonGroup` - Grouped button components
- `Card` - Container components
- `Chip` - Compact information chips
- `Collapsible` - Collapsible content areas
- `EmptyState` - Empty state placeholders
- `Separator` - Visual dividers
- `Sheet` - Slide-out panels
- `Skeleton` - Loading placeholders
### Navigation
- `Menubar` - Horizontal menu bars
- `NavigationMenu` - Main navigation
- `Pagination` - Page navigation
- `Sidebar` - Side navigation with advanced features
- `Tabs` - Tabbed interfaces
### Forms & Inputs
- `Checkbox` - Checkbox inputs
- `Command` - Command palette
- `Form` - Form handling with validation
- `Input` - Text inputs with variants
- `InputOTP` - One-time password inputs
- `Label` - Form labels
- `RadioGroup` - Radio button groups
- `Select` - Dropdown selects
- `Slider` - Range sliders
- `Switch` - Toggle switches
- `TagInput` - Tag input component
- `Textarea` - Multi-line text inputs
- `Toggle` - Toggle buttons
- `ToggleGroup` - Grouped toggle buttons
### Overlays & Modals
- `AlertDialog` - Confirmation dialogs
- `ContextMenu` - Right-click menus
- `Dialog` - Modal dialogs
- `Drawer` - Slide-out panels
- `DropdownMenu` - Dropdown menus
- `HoverCard` - Hover-triggered cards
- `Popover` - Floating content
- `Tooltip` - Information tooltips
### Data Display
- `Alert` - Status messages
- `Avatar` - User avatars
- `Calendar` - Date picker
- `Carousel` - Image carousels
- `Chart` - Data visualization container
- `AreaChart` - Area chart visualization
- `BarChart` - Bar chart visualization
- `LineChart` - Line chart visualization
- `PieChart` - Pie chart visualization
- `RadarChart` - Radar chart visualization
- `RadialChart` - Radial bar chart visualization
- `FileUpload` - File upload component
- `Progress` - Progress indicators
- `ResizablePanel` - Resizable panel groups
- `ScrollArea` - Custom scrollbars
- `Table` - Data tables
### Utilities
- `useToast` - Toast notifications
- `Toaster` - Toast container
- `Snackbar` - Snackbar notifications
- `useMobile` - Mobile detection hook
## šØ Styling Approach
### SCSS-based Styling System
WeLoop ShadCN UI uses a pure SCSS styling approach:
- **SCSS-based Components**: All components are styled with SCSS for consistent design
- **Pre-built Classes**: Components come with ready-to-use SCSS classes
- **No External Dependencies**: Pure SCSS without Tailwind or other styling frameworks
### Using SCSS Classes
Components come with pre-built SCSS classes that you can use directly:
```tsx
<Button className="wl-button wl-button-primary">Click me</Button>
<Card className="wl-card wl-card-elevated">Content</Card>
```
### Responsive Design
All components include responsive SCSS classes:
```tsx
<Button className="wl-button wl-button-responsive">Responsive Button</Button>
```
## š± Responsive Design
All components are built with a mobile-first approach and include responsive SCSS classes:
```tsx
<Button className="wl-button wl-button-responsive">Responsive Button</Button>
```
## āæ Accessibility
Components follow WCAG guidelines and include:
- Proper ARIA attributes
- Keyboard navigation support
- Screen reader compatibility
- Focus management
- Color contrast compliance
## š§ Development
### Building the Library
```bash
npm run build
```
This command builds both the TypeScript/JavaScript code and SCSS styles together.
For individual builds:
```bash
npm run build:js # Build only JavaScript/TypeScript
npm run build:styles # Build only SCSS styles
```
### Running the Demo
```bash
npm run dev
# or
npm run demo
```
The demo will be available at `http://localhost:5173/`
### Building the Demo
```bash
npm run preview
```
## š¦ Package Structure
```
weloop-shadcn-ui/
āāā dist/ # Built library files
ā āāā index.js # Main library bundle
ā āāā index.d.ts # TypeScript definitions
ā āāā styles.css # Compiled styles
āāā src/
ā āāā components/ui/ # UI components
ā āāā hooks/ # Custom hooks
ā āāā lib/ # Utilities and variants
āāā demo/ # Demo application (not included in package)
```
## š Resources
- [React Documentation](https://react.dev/)
- [SCSS Documentation](https://sass-lang.com/)
- [Radix UI Documentation](https://www.radix-ui.com/)
- [Recharts Documentation](https://recharts.org/)
- [React Hook Form Documentation](https://react-hook-form.com/)
- [Changelog](./CHANGELOG.md)
## š¤ Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Built with ā¤ļø by the WeLoop Team