GitHub

File List

A list of existing files (server records) rendered as bordered icon · name · actions rows — the read/manage counterpart to esa-file-upload. Ported from Beacon's simple-file-display.

Stable wc import '@esa/ecology/esa-file-list'; Angular usage

Preview

<esa-file-list id="files"></esa-file-list>

<script>
  el.files = [
    { name: 'nesting-bird-survey-2026.pdf', href: '#' },
    { name: 'weap-signin-2026-05.pdf', href: '#' },
  ];
</script>
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@esa/ecology/esa-file-list';

@Component({
  selector: 'app-file-list-demo',
  standalone: true,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <esa-file-list id="files" [files]="files"></esa-file-list>
  `,
})
export class FileListDemo {
  files = [
    { name: 'nesting-bird-survey-2026.pdf', href: '#' },
    { name: 'weap-signin-2026-05.pdf', href: '#' },
  ];
}

Download & remove

Each row can carry a download action, a remove action, or both. The editor case uses removable with downloadable=false; a read-only display uses the default (download only).

<esa-file-list downloadable removable></esa-file-list>  <!-- both -->
<esa-file-list removable downloadable="false"></esa-file-list>  <!-- remove only -->
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@esa/ecology/esa-file-list';

@Component({
  selector: 'app-file-list-demo',
  standalone: true,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <esa-file-list downloadable removable></esa-file-list>
    <!-- both -->
    <esa-file-list removable downloadable="false"></esa-file-list>
    <!-- remove only -->
  `,
})
export class FileListDemo {}

API

PropTypeDefaultDescription
files EsaFile[] [] The files to list. Set as a property (an array, not an attribute). A row with an href renders its name as a link.
removable boolean false Show a remove button on each row; removing drops it from the local files copy and emits remove.
downloadable boolean true Show a download button on each row (emits download). On by default. Write `="false"` to turn it off — unusually for a boolean attribute, this one reads the value.

Events

EventTypeDefaultDescription
download CustomEvent<{ file, index }> — Fired when a row’s download button is clicked. Composed and bubbles.
remove CustomEvent<{ file, index }> — Fired when a row’s remove button is clicked. The row is removed from the local files copy first. Composed and bubbles.

Accessibility

  • Each action button carries an explicit aria-label naming the file (e.g. “Download nesting-bird-survey.pdf”).
  • File names truncate with ellipsis; the full name is available via the row title.
  • Removing a row updates the local files array and emits remove; consumers persist the change.

Theming surface

Every public token this component reads, extracted from its source at build time, split by blast radius: the hooks that belong to this component, then the shared and system tokens it consumes alongside everything else. The Resolves to column walks each token's real lineage — component → semantic → primitive → raw value — so you can see exactly where re-pointing it lands. A spoke re-skins by overriding these in its theme-<slug>.css; component internals are never edited. No hook for what you need? File it with /request-lego.

Type roles it names

This component does not set a size, weight, face or tracking of its own — it names a composite, and the composite carries all five. A composite is a class rather than a token, so none of it appears in the tables below; re-theme text by re-pointing the token family, not by editing the component.

RoleRe-pointReach
.typography-microcopy-sm-subtle
  • --typography-microcopy-sm-subtle-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-microcopy-sm-subtle-font-size clamp(0.6875rem, 0.61rem + 0.38vw, 0.875rem) via --font-size-150
  • --typography-microcopy-sm-subtle-font-weight 350 via --typography-font-weight-regular → --font-weight-350
  • --typography-microcopy-sm-subtle-letter-spacing 0.01em via --letter-spacing-default
  • --typography-microcopy-sm-subtle-line-height 1 via --line-height-none
+3 more components esa-app-shell, esa-file-upload, esa-filter-dropdown

Wired to this component

No other component reads these — re-point them and esa-file-list is the only thing that moves.

Token Tier Resolves to
--file-list-row-padding-x component 0.75rem via --spacing-300
--file-list-row-padding-y component 2px

Shared tokens it reads

Owned by a family or by the semantic layer. Still overridable — but scope the override (esa-foo { --form-border-color: … }) unless you mean to move everything that reads it. Reach says what else that is.

Token Reach Resolves to
--focus-ring-color component focus ring group · +34 more #3e9b4f via --color-border-default-focus → --color-grass-10
--focus-ring-width component focus ring group · +35 more 2px via --border-width-focus → --border-width-200
--border-width-default semantic every component 1px via --border-width-100
--color-background-elevation-raised semantic every component #fcfcfc via --color-gray-1
--color-background-elevation-sunken semantic every component #f0f0f0 via --color-gray-3
--color-border-default semantic every component one role per property, so a theme can move the ring's weight and its colour independently. Tier 3's --focus-ring-width now reads this instead of holding a bare 2px, which is the same shape --focus-ring-color has always had (a thin tier-3 alias over a tier-2 role) — width was simply never given the tier-2 half. * * This role was rejected once, and the rejection is worth recording because its PREMISE was wrong rather than its reasoning. The argument against an `emphasis` width was that every 2px border in the kit is micro-geometry — spinner rings, the kbd keycap lip, a chevron. The focus ring was not in that enumeration and does not fit it: 33 components render it, more than read any other tier-3 token, and it is not micro-geometry but an accessibility affordance whose weight is a legitimate brand axis (a spoke that needs a heavier ring for contrast has to be able to reach it). It is also not a `border` in any component — every consumer paints it with `outline` or `box-shadow` — which is precisely why a survey of BORDERS missed it. The name still says `border` because tier 2 already calls the ring's colour --color-border-default-focus
--color-content-brand semantic every component #2a7e3b via --color-grass-11
--color-content-default semantic every component #202020 via --color-gray-12
--color-content-default-secondary semantic every component #646464 via --color-gray-11
--color-content-utility-danger semantic every component #ce2c31 via --color-red-11
--radius-sm semantic every component 0.25rem via --radius-100
--transition-fast semantic every component 150ms via --duration-150
--spacing-050 primitive every component 0.125rem
--spacing-150 primitive every component 0.375rem
--spacing-200 primitive every component 0.5rem