Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

A person

Use a preview on a name in running text, so the person's details show without a click.

Name in a sentence
a person's name inside a sentence opens a card with their job title and join date.

Assigned to Asha Verma Asha VermaFinance leadJoined 03-Apr-2023

Show code
<p>
  Assigned to
  <app-hover-card label="Asha Verma, profile">
    <app-hover-card-trigger><a href="/people/asha">Asha Verma</a></app-hover-card-trigger>
    <app-hover-card-content>
      <span class="d-flex flex-column gap-1"><strong>Asha Verma</strong><span class="text-muted">Finance lead</span><span class="text-muted">Joined 03-Apr-2023</span></span>
    </app-hover-card-content>
  </app-hover-card>
</p>

Fetched content

Use a spinner while the preview loads, and start the fetch when the card opens.

Spinner, then the invoice
The loading card and the loaded invoice summary, side by side.
INV-2041Loading INV-2041 summary
INV-2041
INV-2041₹1,24,500 due 14-Nov-2026
INV-2041 summary
Show code
<app-hover-card label="INV-2041 summary" loading="true" open="true">
  <app-hover-card-trigger><a href="/invoices/2041">INV-2041</a></app-hover-card-trigger>
  <app-hover-card-content>...</app-hover-card-content>
</app-hover-card>
<app-hover-card label="INV-2041 summary" open="true">
  <app-hover-card-trigger><a href="/invoices/2041">INV-2041</a></app-hover-card-trigger>
  <app-hover-card-content>
    <div class="d-flex flex-column gap-1"><strong>INV-2041</strong><span>₹1,24,500 due 14-Nov-2026</span></div>
  </app-hover-card-content>
</app-hover-card>

Every option

Every value of every prop, one cell each.

trigger

trigger: a link, the name the card belongs to
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

children

children: any layout, shown when it opens
INV-2041
INV-2041₹1,24,500 due 14-Nov-2026

label

label="Asha Verma, profile": the accessible name, not shown
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

loading

(default, loading off)
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
loading="true": spinner in place of the content while fetching
Asha VermaLoading

loadingLabel

loading-label="Loading" (default)
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
loading-label="Fetching the invoice": beside the spinner while loading
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

openDelay

open-delay="0"
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
open-delay="300" (default)
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
open-delay="1000"
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

closeDelay

close-delay="0"
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
close-delay="150" (default)
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
close-delay="1000"
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

open

(default, closed)
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023
open="true": shows the panel without a hover
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

onOpenChange

onOpenChange, or the wui:hover-card:open and wui:hover-card:close events: called on open and close, no visible change
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

className

className, or class="demo-card": adds classes to the root element, no visible change
Asha VermaAsha VermaFinance leadJoined 03-Apr-2023

Guidance

What to do, and what to avoid.

Use it when

  • A name or record link that people check in passing.
  • A short summary that can be fetched on demand.

Reach for something else when

  • Actions or a form that opens on click. → AppPopover
  • One line of help text. → AppTooltip

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

Asha Verma Asha VermaFinance leadJoined 03-Apr-2023
React, generated from the controls
<AppHoverCard trigger={<a href="/people/asha">Asha Verma</a>} label="Asha Verma, profile">
  ...
</AppHoverCard>
Razor, the same props
<app-hover-card label="Asha Verma, profile">…</app-hover-card>

8 props. The 4 most used come first.

Used on most screens 4 props

PropTypeDefaultDescription
labeldefault - string - The card's accessible name, for example Asha Verma, profile.
loadingdefault false bool false Shows a spinner and the loading label in place of the content while the preview is fetched; start the fetch when the card opens.
open-delaydefault 300 int 300 Milliseconds of hover or focus before it opens.
opendefault false bool false Shows the panel open, for a design preview or a controlled caller.

Less common 4 props

PropTypeDefaultDescription
(trigger)default - markup - The name or link the card belongs to, passed in the trigger slot. Make it a link so keyboard users can focus it.
(content)default - markup - The card's content, any layout, passed in the content slot.
loading-labeldefault Loading string Loading The text beside the spinner.
close-delaydefault 150 int 150 Milliseconds after leaving before it closes.

Screen reader

3 notes
  • The panel has role group, named by the label prop when given, and aria-busy while it loads; the loading text sits in a role status region.
  • The card opens when the trigger takes keyboard focus as well as on hover, and Escape closes it.
  • Touch never opens it, so the trigger must itself lead to the same information, for example a link to the record.