Expand description
§snora-core
The contract and vocabulary layer of the Snora GUI framework.
This crate has no dependency on iced. It defines:
- The shape of an application layout (
AppLayout) — the skeleton an engine implementation is expected to render. - Vocabulary enums that spell out the canonical choices an application
can make:
LayoutDirection,ToastIntent,ToastLifetime,SheetHeight,Icon. - Data contracts for secondary surfaces:
Toast,Dialog,BottomSheet,Menu,MenuItem,SideBar,SideBarItem.
The snora sibling crate binds these contracts to iced and provides the
actual render engine. Other engines (e.g. a test double, a WGPU frontend,
a WASM/HTML backend) could be built against this vocabulary without
depending on iced.
§Non-goals
-
No trait-driven rendering. Earlier drafts of snora exposed a
PageContracttrait that declaredview,dialog,toasts, etc. In practice the render engine did not consume the non-viewmethods, forcing users to plumb them manually. v0.4 drops the trait and keeps all overlay state as plain fields onAppLayout. -
No user-extensible close hooks. Closing an overlay is a single concern with a single channel:
AppLayout::on_close_menusandAppLayout::on_close_modals. IndividualDialog/BottomSheetvalues do not carry their own close messages.
Re-exports§
pub use direction::Edge;pub use direction::LayoutDirection;pub use icon::Icon;pub use layout::AppLayout;pub use menu::Menu;pub use menu::MenuAction;pub use menu::MenuItem;pub use overlay::BottomSheet;pub use overlay::Dialog;pub use overlay::SheetHeight;pub use sidebar::SideBar;pub use sidebar::SideBarItem;pub use toast::Toast;pub use toast::ToastIntent;pub use toast::ToastLifetime;
Modules§
- direction
- Logical layout direction — the foundation of ABDD (Accessible By Default and by Design).
- icon
- Icon vocabulary.
- layout
- The application skeleton —
AppLayout. - menu
- Header menus (File / Edit / View / … drop-downs).
- overlay
- Dialogs and bottom sheets — the modal overlay surfaces.
- sidebar
- Vertical navigation rail (icon-only sidebar).
- toast
- Toast notifications.