Source List
Eine betitelte Liste von Quellen als Chips oder Zeilen, mit Umschalter „Mehr anzeigen“. Oder zu einem Chip mit gestapelten Marken und einer Anzahl zusammengefasst, der die Liste öffnet.
Verfügbar für
Angular: verfügbar Vue: verfügbar React: verfügbar React Native: noch nicht verfügbar
Verwendung
Sources
Harbour Lane kickoff · Mar 3Pricing review · Mar 5Team retro · Mar 9
Sources5
- Harbour Lane kickoffMar 3
- Pricing reviewMar 5
- Team retroMar 9
<div class="demo-stack" style="max-width: 32rem">
<sone-source-list variant="chip" label="Sources" [items]="sources" [trackBy]="byId" [limit]="3">
<ng-template soneSourceListItem [soneSourceListItemOf]="sources" let-s>
<span soneItem variant="outline" size="xs">{{ s.title }} · {{ s.date }}</span>
</ng-template>
</sone-source-list>
<sone-source-list variant="row" size="sm" label="Sources" showCount [items]="sources" [trackBy]="byId" [limit]="3">
<ng-template soneSourceListItem [soneSourceListItemOf]="sources" let-s>
<div soneItem variant="muted" size="xs">
<div soneItemContent>
<span soneItemTitle>{{ s.title }}</span>
<span soneItemDescription>{{ s.date }}</span>
</div>
</div>
</ng-template>
</sone-source-list>
<div>
<button soneSourceListTrigger [count]="sources.length" [attr.aria-expanded]="open()"
[attr.aria-controls]="open() ? 'answer-sources' : null" (click)="open.set(!open())">
<sone-mark icon="meetings" tone="lagoon" size="sm" />
<sone-mark icon="notes" tone="iris" size="sm" />
<sone-mark icon="tasks" tone="amber" size="sm" />
</button>
</div>
@if (open()) {
<sone-source-list id="answer-sources" variant="row" size="sm" ariaLabel="Sources" [items]="sources" [trackBy]="byId">
<ng-template soneSourceListItem [soneSourceListItemOf]="sources" let-s>
<span soneItem variant="muted" size="xs">{{ s.title }} · {{ s.date }}</span>
</ng-template>
</sone-source-list>
}
</div>Import
import {
SoneSourceListComponent,
SoneSourceListItemDirective,
SoneSourceListTriggerComponent,
} from "@surface-one/angular/source-list";API-Referenz
SoneSourceListComponentKomponente
| Name | Typ | Standard |
|---|---|---|
items | readonly T[] | [] |
trackByerforderlich | (item: T) => string | — |
variant | SourceListVariant | "row" |
size | SourceListSize | "default" |
label | string | "" |
ariaLabel | string | null | null |
showCount | boolean | false |
limit | number | null | null |
columns | 1 | 2 | 1 |
list | boolean | null | null |
SoneSourceListItemDirectiveDirektive
| Name | Typ | Standard |
|---|---|---|
soneSourceListItemOf | readonly T[] | null | undefined | undefined |
SoneSourceListTriggerComponentKomponente
`button[soneSourceListTrigger]` — the sources behind an answer folded into one small chip: up to three stacked marks (projected: favicons, `<sone-avatar>`s, marks) and a count (“6 sources”). It is a plain button: open the full `<sone-source-list>` from it (a popover, a sheet or a disclosure) and wire `aria-expanded` / `aria-controls` for what it opens.
| Name | Typ | Standard |
|---|---|---|
countHow many sources there are (the count on the chip). | number | 0 |