Presentation and layer API
Declared by <huxerui/layer.h> and <huxerui/presentation.h>.
Low-level layers
Section titled “Low-level layers”LayerIdis astd::uint64_t;ViewFactoryisstd::function<View()>.LayerLevel:Presentation,Notification,System.LayerPointerPolicy:PassThrough,Content,Barrier.LayerCancelPolicy:PassThrough,Consume,Dismiss.LayerOptions: level, pointer policy, focus trap, outside dismissal, cancel policy, dismissal callback, and optional barrier color.LayerController:Attach,Update, andDismiss, including bound-factory overloads.
Typed presentation
Section titled “Typed presentation”ToastHandle/UseToast,ToastOptions,ToastStyle.DialogHandle/UseDialog,DialogOptions,DialogContext,DialogFactory,DialogStyle, and declarativeDialogmodifier.BottomSheetHandle/UseBottomSheet,BottomSheetOptions,BottomSheetContext,BottomSheetFactory,BottomSheetStyle.PopupHandle/UsePopup,PopupOptions,PopupContext,PopupFactory.MenuHandle/UseMenu,MenuOptions,MenuItem,MenuEntry,MenuSection, andMenuStyle.MenuSeparatorMode:None,BetweenSections, orBetweenItems.Tooltipretained modifier andTooltipStyle.
Anchoring and motion
Section titled “Anchoring and motion”LayerAnchor is obtained from popup/menu handles and attached through .With(...). AnchorSide (Below, Above, Right, Left), AnchorAlignment (Start, Center, End), and AnchorPlacement describe preference. PresentationMotion carries initial scale, slide distance, and enter/exit specs. VerticalPlacement is Top, Center, or Bottom.
Each presentation component page lists exact Show, Update, and dismissal overloads.
Handle and environment contract
Section titled “Handle and environment contract”UseToast, UseDialog, UseBottomSheet, UsePopup, and UseMenu return lightweight handles connected to the current Runtime.
Show captures the current Environment, so theme and resource resolution follow the presenting subtree even though the layer is outside its layout tree.
Custom factories and captured arguments must be copyable because presentation may rebuild them.
Modal surfaces trap focus and use barrier/cancel policy; anchored surfaces retain a LayerAnchor tied to the mounted anchor node.
Calling a disconnected handle or updating an unknown layer is a logic error.
Dismiss explicitly when application state no longer owns the surface; options determine outside-click and cancel behavior.

