- Convert main package to use workspace dependencies - Add all 52 component packages to workspace dependencies - Update README with crates.io installation instructions - Ready for publishing to crates.io!
Leptos ShadCN UI Components
A comprehensive collection of beautiful, accessible UI components built for Leptos v0.8+, inspired by shadcn/ui.
⚠️ IMPORTANT: This project requires Leptos v0.8+ and is NOT compatible with earlier versions.
🚨 Version Requirements
Leptos v0.8+ is MANDATORY for this project.
- ✅ Supported: Leptos v0.8.0, v0.8.1, v0.8.2, v0.8.3, v0.8.4, v0.8.5, v0.8.6, v0.8.7, v0.8.8+
- ❌ NOT Supported: Leptos v0.7.x, v0.6.x, or any earlier versions
- 🔄 Future: Will continue to support the latest Leptos v0.8.x releases
Why v0.8+? This project leverages breaking changes and new features introduced in Leptos v0.8, including improved view macros, better type safety, and enhanced performance.
🚀 Features
- Leptos v0.8+ Required: Built specifically for Leptos v0.8+ and NOT compatible with earlier versions
- ShadCN UI Design: Follows the same design principles and styling as shadcn/ui
- TypeScript Definitions: Full TypeScript support for better developer experience
- Accessibility First: All components follow accessibility best practices
- Customizable: Easy to customize with Tailwind CSS classes
- Lightweight: Only includes the components you need
📊 Current Status
✅ All 52 Components Ready for Production!
All components are now fully tested and working with Leptos v0.8.8:
- Form Components: Button, Input, Label, Checkbox, Switch, Radio Group, Select, Textarea, Form, Combobox, Command, Input OTP
- Layout Components: Card, Separator, Tabs, Accordion, Dialog, Popover, Tooltip, Sheet, Drawer, Hover Card, Aspect Ratio, Collapsible, Scroll Area
- Navigation Components: Breadcrumb, Navigation Menu, Context Menu, Dropdown Menu, Menubar
- Feedback & Status: Alert, Badge, Skeleton, Progress, Toast, Table, Calendar, Date Picker, Pagination, Alert Dialog
- Interactive Components: Slider, Toggle, Carousel
- Advanced Components: Lazy Loading, Error Boundary, Registry, Utils
🎉 The main package now includes all 52 components and is ready for production use!
📦 Available Components
✅ All 52 Components Ready for Production!
The main leptos-shadcn-ui package now contains all 52 components and is ready for production use!
Form Components
- Button - Multiple variants (default, destructive, outline, secondary, ghost, link) and sizes
- Input - Form input with various types and states
- Label - Accessible form labels
- Checkbox - Checkbox with proper accessibility
- Switch - Toggle switch component
- Radio Group - Radio button group with proper grouping
- Select - Dropdown select component
- Textarea - Multi-line text input
- Form - Complete form system with validation and field management
- Combobox - Advanced searchable dropdown with keyboard navigation
- Command - Command palette for keyboard-driven navigation
- Input OTP - One-time password input component
Layout Components
- Card - Content containers with header, content, and footer sections
- Separator - Visual dividers for content organization
- Tabs - Tabbed interface component
- Accordion - Collapsible content sections
- Dialog - Modal dialog component
- Popover - Floating content overlay
- Tooltip - Hover tooltip component
- Sheet - Side panel component
- Drawer - Bottom drawer component
- Hover Card - Hover-triggered information cards
- Aspect Ratio - Responsive aspect ratio containers
- Collapsible - Collapsible content sections
- Scroll Area - Custom scrollable areas
Navigation Components
- Breadcrumb - Navigation breadcrumbs
- Navigation Menu - Main navigation component
- Context Menu - Right-click context menus
- Dropdown Menu - Dropdown navigation menus
- Menubar - Application menubar component
Feedback & Status
- Alert - Informational, warning, success, and error messages
- Badge - Status indicators and labels
- Skeleton - Loading placeholders
- Progress - Progress bars and indicators
- Toast - Notification toasts
- Table - Data table component
- Calendar - Date calendar component
- Date Picker - Date selection component
- Pagination - Page navigation component
- Alert Dialog - Confirmation dialogs
Interactive Components
- Slider - Range slider input
- Toggle - Toggle button component
- Carousel - Image/content carousel
Advanced Components
- Lazy Loading - Dynamic component loading system
- Error Boundary - Runtime error handling and recovery
- Registry - Feature-based component registry
- Utils - Utility functions and helpers
🎉 All 52 components are fully tested and working with Leptos v0.8.8!
🙏 Acknowledgments
This project builds upon the excellent work of several open-source projects:
- shadcn/ui - The original React component library that inspired this port
- Rust for Web shadcn - The original Rust port of shadcn/ui components
- Leptos - The modern Rust web framework that makes this possible
We're grateful to the maintainers and contributors of these projects for their dedication to the Rust and web development communities.
Note
: This repository was generated with the assistance of AI/LLM tools. While the code has been reviewed and tested, please report any issues you encounter.
🛠️ Installation
1. Verify Leptos Version
CRITICAL: Ensure your project uses Leptos v0.8+:
[dependencies]
leptos = "0.8.0" # Must be 0.8.0 or higher
leptos_router = "0.8.0" # Must be 0.8.0 or higher
2. Clone the Repository
git clone https://github.com/cloud-shuttle/leptos-shadcn-ui.git
cd leptos-shadcn-ui
3. Add the Main Package to your Cargo.toml
From crates.io (Recommended):
[dependencies]
leptos-shadcn-ui = "0.1.0"
From source (Development):
[dependencies]
leptos-shadcn-ui = { path = "path/to/leptos-shadcn-ui/packages/leptos-shadcn-ui" }
Note: The main package includes all 52 components and is now available on crates.io! All components are fully tested and working with Leptos v0.8.8!
4. Choose Your Components
All Components (Default):
leptos-shadcn-ui = { path = "path/to/leptos-shadcn-ui/packages/leptos-shadcn-ui" }
# or
leptos-shadcn-ui = { path = "path/to/leptos-shadcn-ui/packages/leptos-shadcn-ui", features = ["all-components"] }
Specific Components Only:
leptos-shadcn-ui = { path = "path/to/leptos-shadcn-ui/packages/leptos-shadcn-ui", features = ["button", "input", "card"] }
Available Features:
- Form Components:
button,input,label,checkbox,switch,radio-group,select,textarea,form,combobox,command,input-otp - Layout Components:
card,separator,tabs,accordion,dialog,popover,tooltip,sheet,drawer,hover-card,aspect-ratio,collapsible,scroll-area - Navigation Components:
breadcrumb,navigation-menu,context-menu,dropdown-menu,menubar - Feedback & Status:
alert,badge,skeleton,progress,toast,table,calendar,date-picker,pagination,alert-dialog - Interactive Components:
slider,toggle,carousel - Advanced Components:
lazy-loading,error-boundary,registry,utils
5. Import and use in your Leptos components
use leptos::*;
use leptos_shadcn_ui::{Button, ButtonVariant, ButtonSize, Input, Card, CardHeader, CardTitle, CardContent};
// Or use the prelude for common components:
// use leptos_shadcn_ui::prelude::*;
#[component] pub fn MyComponent() -> impl IntoView { view! { "Welcome"
## 🎨 Usage Examples
### Button Component
```rust
// Different variants
<Button variant=ButtonVariant::Default>"Default"</Button>
<Button variant=ButtonVariant::Destructive>"Delete"</Button>
<Button variant=ButtonVariant::Outline>"Outline"</Button>
<Button variant=ButtonVariant::Secondary>"Secondary"</Button>
<Button variant=ButtonVariant::Ghost>"Ghost"</Button>
<Button variant=ButtonVariant::Link>"Link"</Button>
// Different sizes
<Button size=ButtonSize::Sm>"Small"</Button>
<Button size=ButtonSize::Default>"Default"</Button>
<Button size=ButtonSize::Lg>"Large"</Button>
<Button size=ButtonSize::Icon>"🔍"</Button>
Input Component
<Input
placeholder="Type something..."
input_type="email"
value=Signal::derive(move || input_value.get())
on_change=Callback::new(move |value| set_input_value.set(value))
/>
Card Component
<Card>
<CardHeader>
<CardTitle>"Card Title"</CardTitle>
<CardDescription>"Card description goes here"</CardDescription>
</CardHeader>
<CardContent>
<p>"Your content here"</p>
</CardContent>
</Card>
Alert Component
<Alert variant=AlertVariant::Default>
<AlertTitle>"Information"</AlertTitle>
<AlertDescription>"This is an informational message."</AlertDescription>
</Alert>
<Alert variant=AlertVariant::Destructive>
<AlertTitle>"Error"</AlertTitle>
<AlertDescription>"Something went wrong."</AlertDescription>
</Alert>
🎯 Demo
Check out the live demo in the examples/leptos directory. To run it:
cd examples/leptos
cargo run
The demo showcases all available components with interactive examples and usage patterns.
🏗️ Project Structure
leptos-shadcn-ui/
├── packages/
│ ├── leptos/ # Leptos-specific components
│ │ ├── button/ # Button component
│ │ ├── input/ # Input component
│ │ ├── card/ # Card component
│ │ ├── alert/ # Alert component
│ │ ├── label/ # Label component
│ │ └── separator/ # Separator component
│ ├── registry/ # Component registry
│ ├── shadcn/ # Core shadcn utilities
│ └── test-utils/ # Testing utilities
├── examples/
│ └── leptos/ # Leptos demo application
└── docs/ # Documentation
## 📋 **Current Development Status**
**🎉 Major Milestone Achieved**: All 52 components are now working and ready for production!
1. **Phase 1 (Complete ✅)**: 25 core components were ready and working
2. **Phase 2 (Complete ✅)**: 27 advanced components have been successfully updated for Leptos 0.8
3. **Phase 3 (Current)**: All components are now available in the main package
**Users can now install from source** and get access to all 52 components immediately!
🔧 Development
Prerequisites
- Rust 1.70+
- Leptos v0.8+ (REQUIRED - no earlier versions supported)
- Node.js (for Tailwind CSS)
Building
# Build all packages
cargo build --workspace
# Build specific package
cargo build -p shadcn-ui-leptos-button
# Run tests
cargo test --workspace
Adding New Components
- Create a new package in
packages/leptos/ - Follow the existing component structure
- Add to the workspace in
Cargo.toml - Update the demo application
- Add TypeScript definitions
🎨 Styling
All components use Tailwind CSS for styling. The design system follows shadcn/ui conventions:
- Colors: Semantic color tokens (primary, secondary, destructive, etc.)
- Spacing: Consistent spacing scale
- Typography: Standard font sizes and weights
- Borders: Consistent border radius and styles
- Shadows: Subtle shadows for depth
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Workflow
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- shadcn/ui for the beautiful design system
- Leptos team for the amazing Rust web framework
- Tailwind CSS for the utility-first CSS framework
🚨 Troubleshooting
Common Issues
"Leptos version not found" or "Incompatible version" errors:
- Ensure you're using Leptos v0.8.0 or higher
- Check your
Cargo.tomlhasleptos = "0.8.0"(not"0.7.0") - Run
cargo updateto ensure you have the latest compatible versions
Compilation errors with view macros:
- These often indicate version incompatibility
- Verify both
leptosandleptos_routerare v0.8.0+
Version Check
Add this to your code to verify the Leptos version at runtime:
use leptos::*;
#[component]
pub fn VersionCheck() -> impl IntoView {
view! {
<div>
<p>"Leptos version: {leptos::VERSION}"</p>
<p>"Required: 0.8.0+"</p>
</div>
}
}
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
Built with ❤️ by the CloudShuttle team