Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Basic

Wrap a chart in a card for its title and subtitle, and drop the controls when a plain card is enough.

A card with a footer
Revenue, this year and last
In rupees
Revenue, this year and last
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000
Show code
<app-chart-card title="Revenue, this year and last" subtitle="In rupees">
  <app-chart type="AppChartType.Column" title="Revenue, this year and last" data="@revenue" x-key="label">…</app-chart>
  <app-chart-card-footer>Source: billing</app-chart-card-footer>
</app-chart-card>
Without the controls
Revenue by month
Revenue by month
CategoryThis year
Apr₹32,40,000
May₹35,10,000
Jun₹33,80,000
Jul₹39,20,000
Aug₹41,20,000
Sep₹46,30,000
Show code
<app-chart-card title="Revenue by month" toolbar="false">…</app-chart-card>

Retry on error

When a chart fails to load, the card offers Try again and the chart says what went wrong.

Try again
Revenue by month
In rupees
Revenue by month
CategoryThis year
Show code
<app-chart-card title="Revenue by month" retry="true"><app-chart state="AppChartState.Error" … /></app-chart-card>

document.addEventListener("wui-chart-card:retry", (e) => reload(e.target));

Every option

Every value of every prop, one cell each.

title: any text, required

title="Revenue by month"
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

subtitle: any text, none by default

subtitle="In rupees"
Revenue by month
In rupees
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000
subtitle omitted (default)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

toolbar: true or false, default true

toolbar="true" (default)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000
toolbar="false"
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

onClick: makes the whole card a button

onClick (React only; Razor has no click)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

onRetry: a callback, none by default

retry="true": shows Try again while the chart is in error
Revenue by month
Revenue by month
CategoryThis yearLast year
retry="false" (default): no Try again button, even on error
Revenue by month
Revenue by month
CategoryThis yearLast year

footer: a node, none by default

<app-chart-card-footer> with a source line
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000
<app-chart-card-footer> omitted (default)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

children: the AppChart, required

app-chart as content (children on React)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

className: any text, none by default

class="border-primary" (React: className)
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

legendLabel: any text, default Show legend

legend-label="Show key": names the legend button for assistive tech
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

legendTitle: any text, default Show or hide the legend

legend-title="Toggle the key": the tooltip on the legend button
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

viewLabel: any text, default View

view-label="Display": names the Chart / Table switch for assistive tech
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

chartViewLabel: any text, default Chart

chart-view-label="Graph": the first segment of the Chart / Table switch
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

tableViewLabel: any text, default Table

table-view-label="Data": the second segment of the Chart / Table switch
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

moreActionsLabel: any text, default More actions

more-actions-label="Actions": names the menu only when the title is empty
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

moreActionsForLabel: any text, default More actions for {title}

more-actions-for-label="Actions for {title}": names the More actions menu
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

downloadPngLabel: any text, default Download PNG

download-png-label="Save as image": the PNG item in the menu
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

downloadCsvLabel: any text, default Download CSV

download-csv-label="Save as spreadsheet": the CSV item in the menu
Revenue by month
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000

retryLabel: any text, default Try again

retry-label="Retry": the button text in the error state
Revenue by month
Revenue by month
CategoryThis yearLast year

Guidance

What to do, and what to avoid.

Use it when

  • A chart that sits on a dashboard or a report page and needs a title and the standard view controls.
  • People should be able to see the numbers as a table, or take them away as a PNG or a CSV.

Reach for something else when

  • A chart inside prose or inside another card. → AppChart
  • A single figure. → AppKpiTile

Reference

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

None A source line
ready loading empty error
Revenue by month
In rupees, April to September 2026
Revenue by month
CategoryThis yearLast year
Apr₹32,40,000₹28,90,000
May₹35,10,000₹31,20,000
Jun₹33,80,000₹33,40,000
Jul₹39,20,000₹34,10,000
Aug₹41,20,000₹36,50,000
Sep₹46,30,000₹39,80,000
React, generated from the controls
<AppChartCard title="Revenue by month"
  subtitle="In rupees, April to September 2026"
  onRetry={reload}>
  <AppChart … />
</AppChartCard>
Razor, the same props
<app-chart-card title="Revenue by month" subtitle="In rupees, April to September 2026" retry="true">
  <app-chart … />
</app-chart-card>

15 props. The 4 most used come first.

Used on most screens 4 props

PropTypeDefaultDescription
titledefault - string - Required. The card's heading. Also names the menu button for assistive tech.
subtitledefault - string - A muted line under the title: the unit or the period.
toolbardefault true bool true Show the view controls.
legend-titledefault Show or hide the legend string Show or hide the legend Replaces the built-in English text, for other languages.

Less common 11 props

PropTypeDefaultDescription
retrydefault false bool false Adds a Try again button that shows while the chart is in its error state, and raises wui-chart-card:retry on the card when pressed.
legend-labeldefault Show legend string Show legend Replaces the built-in English text, for other languages.
view-labeldefault View string View Replaces the built-in English text, for other languages.
chart-view-labeldefault Chart string Chart Replaces the built-in English text, for other languages.
table-view-labeldefault Table string Table Replaces the built-in English text, for other languages.
more-actions-labeldefault More actions string More actions Replaces the built-in English text, for other languages.
more-actions-for-labeldefault More actions for {title} string More actions for {title} Replaces the built-in English text, for other languages. The token {title} is filled with the card's title.
download-png-labeldefault Download PNG string Download PNG Replaces the built-in English text, for other languages.
download-csv-labeldefault Download CSV string Download CSV Replaces the built-in English text, for other languages.
retry-labeldefault Try again string Try again Replaces the built-in English text, for other languages.
<app-chart-card-footer>default - slot - A row under the chart: a source, an updated-at time, a link.

Screen reader

2 notes
  • The legend toggle is a button that reports its state with aria-pressed and is named Show legend.
  • The Try again button is an ordinary button that appears only when onRetry is given and the chart is in its error state.