Hover Card

Rich content that floats under its trigger while the pointer is over either.

Installation

bash
shellui-native add hover-card

Platforms: MAUI · Avalonia. Also installs hover-card-trigger, hover-card-content, element-extensions.

Usage

Basic

Rendered with ShellUI for Blazor
<ui:HoverCard>
    <ui:HoverCardTrigger><ui:Button Text="@shellui" Variant="Link" /></ui:HoverCardTrigger>
    <ui:HoverCardContent>
        <Grid ColumnDefinitions="Auto,*" ColumnSpacing="12">
            <ui:Avatar Source="shellui.png" Fallback="SU" VerticalOptions="Start" />
            <VerticalStackLayout Grid.Column="1" Spacing="4">
                <ui:ShellLabel Text="@shellui" Size="Sm" Weight="Semibold" />
                <ui:ShellLabel Text="Copy-and-own components for Blazor and native .NET apps." Size="Sm" />
                <ui:ShellLabel Text="Joined December 2024" Size="Xs" Variant="Muted" />
            </VerticalStackLayout>
        </Grid>
    </ui:HoverCardContent>
</ui:HoverCard>
Avalonia, running in your browser

MAUI and Avalonia

Both open on mouse hover and toggle on a tap where there's no hover. On Avalonia, Enter or Space on the trigger toggles it too.

API

HoverCard

XAML children go to Items on Avalonia.

Property Type Default Description
OpenDelay int 300 Milliseconds before the card opens / closes after the pointer enters / leaves.
CloseDelay int 200 Milliseconds before the card closes after the pointer leaves.
IsOpen bool false Whether it's open. Two-way bindable.
Event Arguments Description
IsOpenChanged bool Opened or closed.
Method Description
SetOpen(bool value) Opens or closes it.
Toggle() Opens it if closed, closes it if open.
Close() Closes it.

HoverCardTrigger

Method Description
Activate() Does what pressing it does.
ShellTriggerView.ActivateAncestor(Element from) Called by interactive children (Button) after they handle a click.

HoverCardContent

XAML children go to Items on Avalonia and Children on MAUI.

No properties of its own.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.