Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

One resource card

A resource card names the thing the reader gets, with an icon, a title, one line of detail and where it goes.

One resource
Hover it: the whole card lifts to the brand tint, and the icon inverts to stay distinct from it.
Show code
<app-resource-card icon="file-text" title="How risk is scored"
    description="The IEC 62305-2 method, in plain terms" href="/help/risk-scoring" />

A grid of resources

Group related resources in one grid at the foot of a page, so the reader finds the next step there.

A help-centre block
The usual home is a “related help” section at the foot of a page or a sidebar panel.
Show code
<div class="res-grid">
    <app-resource-card icon="file-text" title="How risk is scored" … />
    <app-resource-card icon="download" title="Zone survey template" … />
</div>

Routing and external links

Keep in-app links in the product, and open an outside destination in a new tab with a safe relationship set.

Internal vs external
external adds target="_blank" plus rel="noopener noreferrer". linkComponent is React only: Razor has no router abstraction, so a plain href is already client-navigable here.
Show code
<app-resource-card icon="external-link" title="IEC 62305-2"
    href="https://webstore.iec.ch/" external="true" />

Every option

Every value of every prop, one cell each.

icon: the tile glyph

icon="file-text"
icon="download"
icon="lightbulb"
icon="external-link"

title: the link text

title="Resource title": the link text

description: present vs omitted

href: where the card links

href="/portal/doc": the card links here

external: link target and rel

(default): same tab, no rel
external: new tab, rel="noopener noreferrer"

linkComponent: router link vs plain anchor

(default): plain <a href>
linkComponent={Link} (Razor: href): React receives `to`; Razor always uses a plain href

className passthrough

class="analytics-card": appended, base class kept

Guidance

What to do, and what to avoid.

Use it when

  • You are linking somewhere and the link needs a line of explanation.
  • Several such links sit together as a "related help" or "templates" block.
  • The destination is a document, article, guide or download.

Reach for something else when

  • It is a selectable option in a form. → AppChoiceCard
  • It is a plain navigation link in a menu or nav. → AppShell
  • It performs an action rather than navigating. → AppButton
  • It is a pricing tier. → AppPricingCard

Link text that names the resource

Do

The title names the resource, the text says the format and what to do with it, and the icon matches the action (a download).

Avoid

"Click here" twice tells the reader nothing about the destination, and it is what a screen reader announces as the link name.

Reference

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

file-text download lightbulb external-link
React, generated from the controls
<AppResourceCard
  icon="file-text"
  title="How risk is scored"
  description="The IEC 62305-2 method, in plain terms"
  href="/help/risk-scoring"
/>
Razor, the same props
<app-resource-card icon="file-text" title="How risk is scored" description="The IEC 62305-2 method, in plain terms" href="/help/risk-scoring" />

6 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
icondefault - string - Required. The glyph in the tile: a library icon name.
titledefault - string - Required. The resource's name. It is the link text.
descriptiondefault - string - One line of supporting detail.
hrefdefault - string - Required. Where the card links to.
externaldefault false bool false Open in a new tab.

Less common 1 props

PropTypeDefaultDescription
classdefault - string - Extra classes on the card.

Screen reader

2 notes
  • The whole card is one link, so its accessible name is its text: the title, then the supporting text. The icon glyph is hidden from assistive technology.
  • An external card opens in a new tab with rel="noopener noreferrer".

Do and avoid

1 pairs

Link text that names the resource

Do

The title names the resource, the text says the format and what to do with it, and the icon matches the action (a download).

Avoid

"Click here" twice tells the reader nothing about the destination, and it is what a screen reader announces as the link name.