snora_widgets/lib.rs
1//! # snora-widgets
2//!
3//! Optional prefab `iced::Element` builders for snora's skeleton slots.
4//!
5//! These widgets are entirely **optional** — the snora engine
6//! (`snora::render`) consumes any `iced::Element` in any slot. Use
7//! these helpers to get a working app on screen quickly, and replace
8//! them with hand-written elements the moment you need to customize
9//! beyond what they expose.
10//!
11//! # Crate boundary
12//!
13//! This crate exists so that snora's engine (the `snora` crate) can
14//! evolve independently of widget visuals. Applications normally do
15//! **not** depend on `snora-widgets` directly — `snora` re-exports
16//! everything here under the `snora::widget` module when its
17//! `widgets` feature is enabled (the default).
18//!
19//! Direct `snora-widgets` use is supported for two cases:
20//!
21//! * Engine-only applications that opt out of `snora`'s `widgets`
22//! feature and want to add the widget set back selectively.
23//! * Alternative engines built against `snora-core` that want to
24//! reuse the widget visuals.
25//!
26//! # ABDD
27//!
28//! Every widget that has start/end asymmetry takes a
29//! [`snora_core::LayoutDirection`] argument and mirrors accordingly.
30
31#![warn(missing_docs)]
32#![cfg_attr(docsrs, feature(doc_cfg))]
33
34mod crumb;
35pub mod direction;
36mod footer;
37mod header;
38mod icon;
39mod menu;
40mod sidebar;
41pub mod style;
42mod tab;
43
44/// Prefab design widgets for Snora Design tokens.
45///
46/// Available when the `design` feature is enabled. Provides the
47/// token-styled prefab widgets (`button`, `card`, `notice`, `chip`,
48/// `progress`, chrome geometry) — each wraps a plain iced widget and
49/// applies [`snora_style`] styling internally. **The iced style
50/// bridge itself is [`snora_style`], not this module** — see this
51/// module's own doc comment for the full boundary.
52#[cfg(feature = "design")]
53pub mod design;
54
55pub use crumb::app_breadcrumb;
56pub use footer::app_footer;
57pub use header::app_header;
58pub use icon::{icon_element, icon_element_sized};
59pub use menu::render_menu;
60pub use sidebar::app_side_bar;
61pub use tab::app_tab_bar;
62
63/// Convenience re-export of the Lucide icon constants, available when
64/// the `lucide-icons` feature is enabled.
65#[cfg(feature = "lucide-icons")]
66pub mod lucide {
67 pub use lucide_icons::{Icon::*, LUCIDE_FONT_BYTES};
68}