Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Long notes

Use it for a description or note that runs to many lines on a detail page, so the page stays short.

Project notes
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
Show code
<app-show-more>@Model.Notes</app-show-more>

Short text

Leave the toggle out of short text, since it only appears when the text overflows.

A note that fits
On track.
Show code
<app-show-more>On track.</app-show-more>

Every option

Every value of every prop, one cell each.

children: the text to clamp

children: the text or markup
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

lines: how many lines show while collapsed

lines="1"
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
lines="3" (default)
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
lines="10"
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

moreLabel: the toggle while collapsed

more-label="Show more" (default)
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
more-label="Read more"
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

lessLabel: the toggle while expanded

less-label="Show less" (default)
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
less-label="Read less"
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

defaultExpanded: whether it starts open

expanded="false" (default)
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
expanded="true"
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

id: the root's id

id: sets the root id, no visible effect
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

className: classes on the root

class: adds classes to the root (React className)
The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.

Guidance

What to do, and what to avoid.

Use it when

  • A description, note or comment that can run to many lines on a detail page.

Reach for something else when

  • Hiding one line of a table cell or title with an ellipsis. → a truncated cell
  • Several sections of content that belong behind headings. → AppAccordion

Reference

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

The tower A fit-out covers the lobby, eleven office floors and the roof terrace. Electrical rough-in is complete on floors one to six; floors seven to eleven wait on the revised panel schedule from the consultant. Painting starts once the false ceiling is signed off, and the lift commissioning is booked for the first week of December. Any change to the finish schedule needs the client's written approval before the vendor orders material, because the tile lead time is eight weeks.
React, generated from the controls
<AppShowMore>
  {project.notes}
</AppShowMore>
Razor, the same props
<app-show-more>…</app-show-more>

4 props. The 3 most used come first.

Used on most screens 3 props

PropTypeDefaultDescription
linesdefault 3 int 3 How many lines show while the text is collapsed.
more-labeldefault Show more string Show more The toggle's text while collapsed.
less-labeldefault Show less string Show less The toggle's text while expanded.

Less common 1 props

PropTypeDefaultDescription
expandeddefault false bool false Start with the whole text showing.

Screen reader

3 notes
  • The clamp is visual: the full text stays in the page for screen readers.
  • The toggle is a button that reports aria-expanded and points at the text with aria-controls.
  • The toggle shows only when the text overflows, and without script the text shows in full.