The Overlays Foundation provides core services for building overlay components like Dialogs, Snackbars, and custom components. This page demonstrates the foundation services with interactive examples.
For App Developers: See the
Dialogs
page for foundation services in context of real components.
For Component Developers: This page shows how to use foundation services directly when building custom overlay components.
1. Stack Manager Visualizer
The OverlayStackManager tracks all open overlays and assigns z-index values. Use this visualizer to see how overlays stack in real-time.
Current Overlay Stack
No overlays currently open. Use the buttons below to spawn test overlays.
Statistics
Total Open:0
Modal Overlays:0
Top Z-Index:N/A
csharp
@inject IOverlayStackManager StackManager
// Register an overlay
var registration = new OverlayRegistration(
id: Guid.NewGuid(),
type: OverlayType.Dialog,
isModal: true
);
var zIndex = StackManager.Register(registration);
// Unregister when done
StackManager.Unregister(registration.Id);
2. Focus Trap Sandbox
The FocusTrapService keeps keyboard navigation within a container. Try tabbing through the sandbox to see focus cycling in action.
Focus Trap Container
When focus trap is enabled, Tab/Shift+Tab will cycle through the elements below and cannot escape this container.