On this page
@addTagHelper *, Webority.Ui.RazorFiles
Show the files a person reads or opens as tiles, with a link on each file that has a destination.
Default
Three files, each with a type tile, its name, size and a meta line; two are links and one is plain.
- Project brief.pdf
- Site plan.png
- Meeting notes.docx
Every option
Every value of every prop, one cell each.
label
label: names the list for screen readers, no visual change
- Meeting notes.docx
files
files: no app-file-tile children (default)
name: its extension makes the type tile
- Site plan.png
href: makes the tile a link
size-bytes: the size in bytes, shown as a readable size (React: sizeBytes)
- Meeting notes.docx
meta: text after the size
- Meeting notes.docx
className
class: extra classes on the list (React: className)
- Meeting notes.docx
Guidance
What to do, and what to avoid.
Use it when
- A few files attached to a record that the person reads rather than edits.
- Files that open or download from the page, each shown with its type and size.
Reach for something else when
- The person picks or uploads the files. → AppFileAttachment
- One file to read in the page. → AppFileViewer
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
5 props. The 1 most used come first.
Used on most screens 1 props
| Prop | Type | Default | Description |
|---|---|---|---|
| labeldefault - | string | - | Accessible name of the list. |
Less common 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| app-file-tile namedefault - | string | - | The file name. Its extension makes the type tile. Required. |
| app-file-tile hrefdefault - | string | - | The address the file opens or downloads from. The tile is a link when set. |
| app-file-tile size-bytesdefault - | number | - | The file size in bytes, shown as a size such as 1.5 MB. |
| app-file-tile metadefault - | string | - | Text after the size, such as a person and a date. |
Screen reader
3 notes- The list takes its accessible name from label.
- The type tile is hidden from assistive technology; the file name carries the meaning.
- A file with an href is a link; a file without one is plain text.