Download Progress
Une barre de progression avec une légende mise à jour en direct et une action d’annulation facultative.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: pas encore disponible
Utilisation
<div class="demo-stack" style="max-width: 26rem">
@if (cancelled()) {
<div class="demo-row">
<span style="color: var(--text-secondary)">Download cancelled.</span>
<button soneBtn type="button" size="sm" variant="outline" (click)="cancelled.set(false)">Retry</button>
</div>
} @else {
<sone-download-progress
[frac]="0.42"
cancellable
ariaLabel="Example model download"
(cancelRequested)="cancelled.set(true)"
/>
}
<sone-download-progress [frac]="null" label="Preparing…" ariaLabel="Preparing files" />
<sone-download-progress label="Example-3B" separator=" · " [frac]="0.63" ariaLabel="Example-3B download" />
<sone-download-progress size="md" [frac]="0.7" ariaLabel="Setup progress" />
</div>Importation
import {
SoneDownloadProgressComponent,
} from "@surface-one/angular/download-progress";Référence de l’API
SoneDownloadProgressComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
frac | number | null | null |
label | — | $localize`Downloading…` |
separator | string | " " |
ariaLabel | string | null | null |
size | SoneProgressSize | "sm" |
cancellable | boolean | false |
cancelLabel | — | $localize`Cancel download` |
| Nom | Type |
|---|---|
cancelRequested | void |