Skip to main content

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
34pub mod direction;
35mod crumb;
36mod footer;
37mod header;
38mod icon;
39mod menu;
40mod sidebar;
41pub mod style;
42mod tab;
43
44pub use crumb::app_breadcrumb;
45pub use footer::app_footer;
46pub use header::app_header;
47pub use icon::{icon_element, icon_element_sized};
48pub use menu::render_menu;
49pub use sidebar::app_side_bar;
50pub use tab::app_tab_bar;
51
52/// Convenience re-export of the Lucide icon constants, available when
53/// the `lucide-icons` feature is enabled.
54#[cfg(feature = "lucide-icons")]
55pub mod lucide {
56    pub use lucide_icons::Icon::*;
57}