# Getting started (oxblade-icons)

> This page adds oxblade-icons and a generated icon set to a Rust project and renders a first icon.

- Package: oxblade-icons (Rust, alpha), crates: `oxblade-icons`
- Maintenance: active; Latest release: 0.1.0 (2026-12-05); MSRV: Rust 1.99 or later; Licence: MIT
- Links: [Repository](https://github.com/bowerbird-si/oxblade-icons), [crates.io](https://crates.io/crates/oxblade-icons/0.1.0), [docs.rs](https://docs.rs/oxblade-icons/0.1.0), [Changelog](https://oss.bowerbird.si/oxblade-icons/docs/changelog/), [Contributing](https://github.com/bowerbird-si/oxblade-icons/blob/c7e0252d5f06a12c2c4687fa63a4aa97d51b0e4c/CONTRIBUTING.md), [Security policy](https://github.com/bowerbird-si/oxblade-icons/blob/c7e0252d5f06a12c2c4687fa63a4aa97d51b0e4c/SECURITY.md)
- Based on: [blade-ui-kit/blade-icons](https://github.com/driesvints/blade-icons): The PHP renderer and template behavior this package ports.
- PHP parity: core (4 covered, 4 diverged, 3 planned of 11 abilities; 14 fixtures; follows blade-ui-kit/blade-icons 1.11.0; verified 2026-12-05)
- HTML version: https://oss.bowerbird.si/oxblade-icons/docs/getting-started/
- Source: https://github.com/bowerbird-si/oxblade-icons/blob/c7e0252d5f06a12c2c4687fa63a4aa97d51b0e4c/docs/getting-started.md

This page adds oxblade-icons and a generated icon set to a Rust project and renders a first icon.

## Install

Add the renderer and the icon set you want. The example uses Lucide from its source repository:

```toml
[dependencies]
oxblade-icons = "0.1"
oxblade-lucide = { git = "https://github.com/bowerbird-si/oxblade-icon-sets" }
```

`oxblade-heroicons` comes from the same repository. The `blade` feature (on by default) adds the oxblade
template integration; `laravel` adds the service provider. See [the features table](https://github.com/bowerbird-si/oxblade-icons#installation-and-configuration).

## Render an icon

Build a registry once, at startup, and keep it for the life of the program:

```rust
use oxblade_icons::{Attributes, Icons, icon_set};

fn main() -> oxblade_icons::Result<()> {
    let icons = Icons::builder()
        .set(icon_set!(oxblade_lucide))
        .class("icon")
        .build()?;

    let svg = icons.svg("lucide-map-pin", "w-4", Attributes::new().decorative())?;
    println!("{svg}");
    Ok(())
}
```

`icon_set!(oxblade_lucide)` turns the generated crate into a registered set with the name `lucide` and the
prefix `lucide`. The name `lucide-map-pin` means "the `map-pin` icon in the set whose prefix is
`lucide`". The output is the Lucide SVG with `class="icon w-4"` and `aria-hidden="true"` added to its
`<svg>` element.

`build()` checks the configuration: set names and prefixes must be unique and well-formed, and every
fallback must resolve. A mistake fails at startup instead of on a page.

## Next

- [Icon sets](https://oss.bowerbird.si/oxblade-icons/docs/icon-sets/): Heroicons names, your own SVGs, per-set defaults and fallbacks.
- [Rendering icons](https://oss.bowerbird.si/oxblade-icons/docs/rendering/): attributes, titles and errors.
- [Blade templates](https://oss.bowerbird.si/oxblade-icons/docs/blade/): the same icons from oxblade.
