Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

A dashboard

Tiles across the top and two charts below make the layout a dashboard uses for its figures and trends.

Tiles and charts
Orders
1,284
Revenue
₹38 L
Refunds
₹1.2 L
Revenue by month
In rupees
Revenue by month
CategoryRevenue
Apr₹32,40,000
May₹35,10,000
Jun₹33,80,000
Jul₹39,20,000
Aug₹41,20,000
Sep₹46,30,000
Traffic by source
Traffic by source
CategoryVisitsShare
Search5,20053.6%
Direct3,10032%
Referral1,40014.4%
Show code
<app-dashboard-grid>
    <app-dashboard-cell span="Quarter"><app-kpi-tile label="Orders" value="1,284"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Quarter"><app-kpi-tile label="Revenue" value="₹38 L"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Quarter"><app-kpi-tile label="Refunds" value="₹1.2 L"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Half"><app-chart-card title="Revenue by month">…</app-chart-card></app-dashboard-cell>
    <app-dashboard-cell span="Half"><app-chart-card title="Traffic by source">…</app-chart-card></app-dashboard-cell>
</app-dashboard-grid>

Spans

A cell takes a Quarter, Third, Half, TwoThirds or Full share of the twelve columns, and a row fills when its shares add up to the whole.

Three of 4
Cell 1
span Third
Cell 2
span Third
Cell 3
span Third
Show code
<app-dashboard-cell span="Third">…</app-dashboard-cell> ×3
Eight and 4
Work lane
span TwoThirds
Glance rail
span Third
Show code
<app-dashboard-cell span="TwoThirds">…</app-dashboard-cell>
<app-dashboard-cell span="Third">…</app-dashboard-cell>

Five to a row

Five tiles share one row from 992px, three to a row from 576px, and stack on a phone.

Five tiles to a row
Open
12
In progress
7
Waiting
4
Overdue
3
Unassigned
9
Show code
<app-dashboard-grid>
    <app-dashboard-cell span="Fifth"><app-kpi-tile label="Open" value="12"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Fifth"><app-kpi-tile label="In progress" value="7"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Fifth"><app-kpi-tile label="Waiting" value="4"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Fifth"><app-kpi-tile label="Overdue" value="3"></app-kpi-tile></app-dashboard-cell>
    <app-dashboard-cell span="Fifth"><app-kpi-tile label="Unassigned" value="9"></app-kpi-tile></app-dashboard-cell>
</app-dashboard-grid>

Every option

Every value of every prop, one cell each.

children: AppDashboardCells

children
Orders
1,284

className: extra classes

class="my-grid" (the React className: adds extra classes to the grid, no visible change here)
Orders
1,284

span: all six

span="Quarter"
Cell
span Quarter
span="Third"
Cell
span Third
span="Half"
Cell
span Half
span="TwoThirds"
Cell
span TwoThirds
span="Full" (default)
Cell
span Full
span="Fifth"
Cell
span Fifth

Guidance

What to do, and what to avoid.

Use it when

  • A page of KPI tiles and chart cards that should line up and stack on a phone.
  • A layout the page decides, with no drag and drop or saved layouts.

Reach for something else when

  • A form or a content page. → AppFormSection
  • A layout that needs other widths than a quarter, a third, a half, two thirds, a fifth or the full row. → Bootstrap's Row and Col

Reference

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

Quarter Third Half TwoThirds Full
Orders
1,284
Revenue
₹38 L
Refunds
₹1.2 L
React, generated from the controls
<AppDashboardGrid>
  <AppDashboardCell span="Quarter">…</AppDashboardCell>
  <AppDashboardCell span="Half">…</AppDashboardCell>
  <AppDashboardCell span="Quarter">…</AppDashboardCell>
</AppDashboardGrid>
Razor, the same props
<app-dashboard-grid>
  <app-dashboard-cell span="Quarter">…</app-dashboard-cell>
  <app-dashboard-cell span="Half">…</app-dashboard-cell>
  <app-dashboard-cell span="Quarter">…</app-dashboard-cell>
</app-dashboard-grid>

1 props.

Less common 1 props

PropTypeDefaultDescription
spandefault Full Quarter | Third | Half | TwoThirds | Full | Fifth Full On <app-dashboard-cell>: the share of the row the cell takes (3, 4, 6, 8 or 12 of the twelve columns), or Fifth for a fifth of the row. A name outside the list fails the page's build.

Screen reader

2 notes
  • The grid is a plain div with no role or aria attributes; each cell's content carries its own semantics.
  • Under 576px every cell takes the full width, one above another.