NotchView
A Dynamic Island style surface that holds anything and morphs its width, height and corner radius to fit it. There are no compact or expanded states to manage. Put a view inside it and the notch sizes itself to that view. Swap the content, or let the content change its own size, and it springs to the new size.
Features
Section titled “Features”- Sizes to its content: content plus padding, clamped between a minimum and a maximum, with the parent’s width as a cap so wide content wraps
- Follows the content: a content swap, or content that grows or shrinks on its own, springs the notch to the new size, with no call needed
- The content is laid out once at its final size and the surface clips it while it animates, so text never re-wraps mid-morph
- The content is pinned to the top of the surface, which grows and shrinks from its top edge, so a header or tab strip along the top stays still while the bottom is revealed or clipped
- Wrapping text inside content with a fixed
WidthRequestis measured at that width, so every line fits - New content fades in on a swap
Island(every corner rounded) orNotch(square top corners, flush with the top edge) shapes- Blazor: overlays the very top of the screen by default, in the browser’s top layer, above everything on the page;
Inlinelays it out in the page flow instead - Automatic corners: a full pill while short, capped at 28 as it grows tall, so it never turns into an oval
- Tap/click events, a
NotchSizeChangedevent when a morph starts, andMorphCompletedon MAUI - Blazor honours
prefers-reduced-motion - Desktop: the Desktop add-on puts the notch in a window above every other app on Windows, Linux and macOS: in the MacBook camera notch, or as an island floating at the top of the screen
<Grid> <ScrollView> <VerticalStackLayout Padding="16,120,16,16"> <!-- page content --> </VerticalStackLayout> </ScrollView>
<!-- same Grid cell, so it floats over the page, top-centre by default --> <shiny:NotchView x:Name="Notch" Margin="0,12,0,0" Tapped="OnNotchTapped"> <HorizontalStackLayout Spacing="8"> <Ellipse Fill="Red" WidthRequest="10" HeightRequest="10" VerticalOptions="Center" /> <Label Text="0:42" TextColor="White" FontAttributes="Bold" /> </HorizontalStackLayout> </shiny:NotchView></Grid>Notch.Content = new NowPlayingView(); // grows to fit; the new content fades inNotch.Content = null; // back to MinNotchWidth x MinNotchHeightBlazor
Section titled “Blazor”<NotchView ContentKey="@state" OnClick="Toggle" OnNotchSizeChanged="s => size = s"> @switch (state) { case "recording": <span style="font-weight:700">● 0:42</span> break; case "playing": <NowPlaying /> break; }</NotchView>Change ContentKey when you switch to different content, and the new content fades in. Content that only changes size needs no key; a ResizeObserver follows it.
The notch overlays the very top of the screen wherever the component sits: it opens as a manual popover, so it lives in the browser’s top layer, flush with the top edge of the viewport and centred, above the page, its scroll and any parent’s overflow, transform or z-index. An Island floats 8px below the edge (plus the safe-area inset), and --shiny-notch-offset moves either shape down. Set Inline="true" to put it back in the page flow, centred in its parent, for a notch inside a card or a device mock-up.
Properties
Section titled “Properties”| Property | Type (MAUI / Blazor) | Default | Description |
|---|---|---|---|
Content / ChildContent |
View / RenderFragment | null | Anything. The notch sizes itself to it |
ContentKey |
— / object | null | Blazor: change it on a content swap to fade the new content in |
Inline |
bool (Blazor) | false | false overlays the top of the screen; true lays it out in the page flow |
Shape |
NotchShape | Island (MAUI) / Notch (Blazor) | Island or Notch (square top corners) |
SurfaceColor |
Color / string | Black | The fill, black on every theme. Give the content light text. Blazor: --shiny-notch-surface |
Stroke / StrokeThickness |
Color / string, double | none | Optional outline |
ContentPadding |
Thickness / string | 14,8 / 8px 14px |
Space between the edge and the content |
MinNotchWidth / MinNotchHeight |
double | 120 / 36 | The smallest size, and the size with no content |
MaxNotchWidth / MaxNotchHeight |
double | unbounded | Caps. The parent’s width is also a cap |
CornerRadius |
double | -1 | -1 = automatic pill, capped at 28. Clamped to half the height |
MorphDuration |
ms | 420 | 0 snaps |
MorphEasing |
Easing (MAUI) | soft spring | Blazor uses a matching cubic-bezier |
HasShadow |
bool | true | Soft drop shadow |
Command / CommandParameter |
MAUI | null | Run on a tap of the surface |
NotchSize / Size |
read-only | The size it is at, or morphing towards |
Events: Tapped, NotchSizeChanged, MorphCompleted (MAUI); OnClick, OnNotchSizeChanged (Blazor). On Blazor, clicks inside the content bubble up to OnClick, so give inner buttons @onclick:stopPropagation when they should not count as a click on the notch.
Over every app (desktop window)
Section titled “Over every app (desktop window)”Shiny.Maui.Controls.Desktop puts a NotchView in a borderless window at the top-centre of the screen, above every other app, on macOS, Windows and Linux. It works like the quick entry popup: an OS window, not something drawn inside your app, so it stays on screen while the user works in other apps.
- On a MacBook it lives in the hardware camera notch. The empty notch is exactly the size of the cut-out, so it disappears into it. Give it content and it grows down out of the notch, with the content padded below the camera housing.
- Everywhere else (a Mac display without a notch, every Windows and Linux screen) it floats as an island centred at the top of the screen,
TopMarginbelow the menu bar, a top-docked taskbar or a top panel. SetTopMargin = 0andShape = NotchShape.Notchfor a notch that hangs from the top edge.
| Recording | Now playing | Message |
|---|---|---|
![]() |
![]() |
![]() |
#if !ANDROID && !IOS && !MACCATALYSTbuilder .UseShinyControls() .UseShinyDesktop(cfg => cfg.ConfigureNotch(o => { o.MaxWidth = 520; o.Configure = notch => notch.SurfaceColor = Colors.Black; }));
// INotchWindowService, injectedawait notchWindow.ShowAsync(new Label { Text = "Recording 0:42", TextColor = Colors.White });await notchWindow.SetContentAsync(new NowPlayingView()); // grows to fitawait notchWindow.SetContentAsync(null); // back to the empty notchnotchWindow.Hide();
// expand on hover, whether or not your app is activenotchWindow.PointerEntered += (_, _) => Expand();notchWindow.PointerExited += (_, _) => Collapse();#endifNotchWindowOptions |
Default | |
|---|---|---|
UseHardwareNotch |
true | Hug the camera notch when the screen has one (macOS) |
TopMargin |
8 | Gap between the top of the usable screen area and the floating island |
MaxWidth / MaxHeight |
640 / 480 | Caps, in points |
MorphDuration |
300 | Window reshape time, ms. 0 snaps |
JoinAllSpaces |
true | Every Space and over full-screen apps (macOS); every workspace (Linux X11); ignored on Windows |
Configure |
null | Styles each NotchView the service creates. Runs last, so it wins |
More than one display
Section titled “More than one display”INotchWindowService is the primary display’s notch. To show a notch on other displays, or on several at once, inject INotchWindowFactory, which UseShinyDesktop() also registers. GetDisplays() lists the displays, the primary first, and Create(displayId) makes a notch on one of them.
#if !ANDROID && !IOS && !MACCATALYST// INotchWindowFactory, injected (UseShinyDesktop registers it next to INotchWindowService)foreach (var display in factory.GetDisplays()) // the primary first{ // display.Id survives relaunches: save it to remember the user's choice var notch = factory.Create(display.Id); // you own it: Dispose() closes its window await notch.ShowAsync(new Label { Text = display.Name, TextColor = Colors.White });}#endifNotchDisplay |
|
|---|---|
Id |
Survives relaunches, for saving the user’s choice: vendor, model and serial number on macOS, the device name on Windows, the connector on Linux |
Name |
What to call the display in a list (“Built-in Retina Display”, “DELL U2720Q”) |
IsPrimary |
The display with the menu bar (macOS), or the main display |
HardwareNotchSize |
This display’s camera cut-out; Size.Zero without one |
Each notch works out its own display’s geometry, so with a MacBook open beside an external monitor the built-in display’s notch grows out of the camera and the monitor’s has no cut-out. You own a notch from Create: dispose it when its display goes, which closes its window. An id that isn’t connected falls back to the primary display.
Per platform
Section titled “Per platform”| macOS | Windows | Linux (X11) | Linux (Wayland) | |
|---|---|---|---|---|
| Position | Camera notch, or under the menu bar, on the display asked for | Top-centre of the monitor asked for (the primary by default) | Top-centre of the monitor asked for (the primary by default) | Chosen by the compositor |
| Above other apps | Yes | Yes | Yes | No |
| In the taskbar / app switcher | No | No | No | Compositor’s choice |
| Morph | Native window animation | Window resized every frame | Window resized every frame | Window resized every frame |
| Content swap | Old content collapses with the window and fades out; new content fades in | New content fades in | New content fades in | New content fades in |
| Edges | Antialiased | Aliased (window region) | Antialiased (needs a compositor) | Antialiased |




