glaze/basecoat/icon
Icon helpers for Lucide icons in Basecoat UIs.
Basecoat uses Lucide icons: https://lucide.dev
Anatomy
icon: render an icon placeholder elementinit: load Lucide via ESM (bundler/import map)register_cdn: load Lucide via CDN (no bundler)
Recipes
import glaze/basecoat/icon
icon.icon("plus", [])
import glaze/basecoat/icon
html.head([], [
// Prefer a pinned version in real projects.
icon.register_cdn("latest"),
])
References
- Lucide icon list: https://lucide.dev/icons
- Lucide package guide: https://lucide.dev/guide/packages/lucide
Values
pub fn alert_circle(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn alert_triangle(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn arrow_left(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn arrow_right(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn bold() -> attribute.Attribute(a)
pub fn calendar(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn check(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn check_circle(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn chevron_down(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn chevron_left(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn chevron_right(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn chevron_up(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn clock(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn copy(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn download(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn edit(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn external_link(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn eye(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn eye_off(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn facebook(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn file(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn filter(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn folder(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn github(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn grid(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn heart(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn home(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn icon(
name: String,
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
Render a Lucide icon by name.
Use the icon name from lucide.dev/icons.
Example
import glaze/basecoat/icon
icon.icon("plus", [attribute.class("size-4")])
pub fn image(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn info(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn init() -> element.Element(a)
Initialize Lucide icons.
Add this script to your <head> to enable Lucide icon rendering.
Requires a JS setup that can resolve import ... from "lucide".
pub fn instagram(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn key(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn link(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn linkedin(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn list(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn loader(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn lock(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn mail(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn menu(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn minus(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn moon(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn more_horizontal(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn more_vertical(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn music(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn normal() -> attribute.Attribute(a)
pub fn phone(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn plus(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
Common icons as constants for convenience.
pub fn refresh(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn register_cdn(lucide_version: String) -> element.Element(a)
Initialize Lucide icons via CDN (no bundler).
This injects Lucide’s UMD build from unpkg and runs lucide.createIcons() on
DOMContentLoaded.
Lucide recommends pinning a specific version instead of using latest.
See: https://lucide.dev/guide/packages/lucide
pub fn save(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn search(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn settings(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn share(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn size_lg() -> attribute.Attribute(a)
pub fn size_md() -> attribute.Attribute(a)
pub fn size_sm() -> attribute.Attribute(a)
pub fn size_xl() -> attribute.Attribute(a)
pub fn sort(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn star(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn sun(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn thumbs_down(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn thumbs_up(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn trash(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn twitter(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn unlock(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn upload(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn user(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn video(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn x(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn x_circle(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn youtube(
attrs: List(attribute.Attribute(a)),
) -> element.Element(a)