Crate leptos_lucide_rs

Crate leptos_lucide_rs 

Source
Expand description

§Leptos Lucide Icons

A comprehensive Lucide icon library for Leptos with tree-shaking support.

§Features

  • 🌳 Tree-shaking: Only bundle the icons you actually use
  • Zero-cost: All icon components are #[inline(always)] for maximum performance
  • 🦀 Rust-friendly: Generated component names follow Rust conventions
  • 🔒 Type-safe: Each icon is a separate typed component
  • 🎨 Customizable: Easy styling with CSS classes and inline styles

§Usage

use leptos::prelude::*;
use leptos_lucide_rs::*;

#[component]
pub fn MyComponent() -> impl IntoView {
    view! {
        <div>
            <Home/>
            <User/>
            <Heart/>
        </div>
    }
}

§Custom Styling

use leptos::prelude::*;
use leptos_lucide_rs::*;

#[component]
pub fn StyledIcons() -> impl IntoView {
    view! {
        <div>
            // Using the macro for custom classes
            // TODO:
            // {icon!(Home, class = "text-blue-500 w-6 h-6")}

            // Using the macro for custom sizes
            // TODO:
            // {icon!(User, size = "32px")}

            // Direct component with custom attributes
            <div class="icon-wrapper">
                <Search/>
            </div>
        </div>
    }
}

Macros§

dyn_icon
Convenient alias for dynamic icons Simple macro to create dynamic icons by using the load_icon function
dynamic_icon
Simple macro to create dynamic icons by using the load_icon function
icon
Utility macro for quick icon creation with builder pattern (enhanced)

Structs§

IconConfig
Icon configuration for customizing appearance
IconProps
Props for the Icon component.

Functions§

Activity
AlertCircle
AlertTriangle
AlignCenter
AlignLeft
AlignRight
ArrowDown
ArrowDownLeft
ArrowLeft
ArrowRight
ArrowUp
ArrowUpRight
BarChart
Bell
Bold
Briefcase
Building
Calendar
Camera
Check
CheckCircle
ChevronDown
ChevronLeft
ChevronRight
ChevronUp
Circle
Clock
Cloud
Code
Copy
CornerDownLeft
CreditCard
Database
Download
Edit
ExternalLink
Eye
EyeOff
Facebook
File
Filter
FlipHorizontal
Folder
GitBranch
GitCommit
GitMerge
Github
Heart
HelpCircle
Hexagon
Home
Icon
Helper component for rendering icons with configuration (enhanced version)
Image
Info
Instagram
Italic
Key
Layout
Linkedin
Loader
Lock
Mail
MapPin
Maximize
Menu
MessageCircle
Mic
Minimize
Minus
Moon
MoreHorizontal
MoreVertical
Move
Music
Panels
Pause
Phone
PieChart
Play
Plus
RefreshCw
RotateCw
Search
Server
Settings
Share
Shield
ShoppingCart
Sidebar
SkipBack
SkipForward
Square
Star
Sun
Terminal
ThumbsUp
Trash
TrendingDown
TrendingUp
Triangle
Twitch
Twitter
Type
Underline
Unlock
Upload
User
Video
Volume2
Wifi
X
XCircle
Youtube
Zap
load_icon
Load an icon by name at runtime