Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Default lines

The default draws three lines, with the last one at 60% so the block reads as a paragraph.

Three lines
Show code
<app-skeleton-lines></app-skeleton-lines>

Longer paragraph

Use more lines for a longer paragraph, and a shorter last line so the text edge looks natural.

Five lines, last at 40%
Show code
<app-skeleton-lines lines="5" last-line-width="40%"></app-skeleton-lines>

Every option

Every value of every prop, one cell each.

lines: the number of lines

lines="1"
lines="3" (default)
lines="12"

lastLineWidth: the width of the last line

last-line-width="40%"
last-line-width="60%" (default)
last-line-width="12rem"

className: extra classes

class="…" (adds extra classes to the wrapper, no visible change here)

style: an inline style

style={{ width: "240px" }}, React only

Guidance

What to do, and what to avoid.

Use it when

  • A paragraph of text is loading and the page should hold its shape.
  • A card or a description is waiting for its first data.

Reach for something else when

  • A single bar stands in for one element, such as a heading or a value. → AppSkeleton
  • A table is loading its first page. → AppSkeletonRows
  • The data loaded but the result set is empty. → AppEmptyState
  • The whole page is blocked on a single request. → a page-level spinner

Reference

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

React, generated from the controls
<AppSkeletonLines lines={3} lastLineWidth="60%" />
Razor, the same props
<app-skeleton-lines lines="3" last-line-width="60%" />

3 props. The 2 most used come first.

Used on most screens 2 props

PropTypeDefaultDescription
linesdefault 3 int 3 How many lines to draw, an integer from 1 to 12. Any other value renders the default and warns.
last-line-widthdefault 60% string 60% Width of the last line as a CSS length string, such as 60% or 12rem. The other lines are full width.

Less common 1 props

PropTypeDefaultDescription
classdefault - string - Extra class on the wrapper.

Screen reader

2 notes
  • The wrapper is aria-hidden, so screen readers skip the placeholder lines.
  • The lines have no role and take no focus.