freya_icons/
lib.rs

1//! Icon assets for Freya UI.
2//!
3//! Currently the `lucide` feature enables the Lucide icons.
4//!
5//! # Example
6//!
7//! The example below shows using an icon with the `svg` element.
8//!
9//! See `examples/feature_icons.rs` for a live example.
10//!
11//! ```rust
12//! # use freya::prelude::*;
13//! # #[cfg(feature = "lucide")]
14//! fn app() -> impl IntoElement {
15//!     svg(freya_icons::lucide::antenna())
16//!         .color((120, 50, 255))
17//!         .width(Size::px(48.))
18//!         .height(Size::px(48.))
19//! }
20//! ```
21
22#[cfg(feature = "lucide")]
23pub mod lucide {
24    include!(concat!(env!("OUT_DIR"), "/lucide.rs"));
25}
26
27#[macro_export]
28macro_rules! generate_svg {
29    ($name:ident, $path:expr) => {
30        #[allow(unused)]
31        pub fn $name() -> bytes::Bytes {
32            bytes::Bytes::from_static(include_bytes!($path))
33        }
34    };
35}