Uploader
Select and validate local files with previews and application-driven upload state.
import { NeuUploaderComponent } from '@neural-ui/core/uploader';Usage
Examples
Choose files
Drop files here or choose them ยท Allowed types: .txt,.pdf ยท Maximum size: 1.0 MB
0 selected files
Events: 0
Try and configure
Choose files
Drop files here or choose them ยท Allowed types: .txt,.pdf ยท Maximum size: 1.0 MB
Use Fail beside a file to simulate a failed upload, then Retry. No files are uploaded.
0 selected files
Events: 0
<neu-uploader
[value]="value()"
(valueChange)="onValueChange($event)"
[disabled]="false"
[readonly]="false"
[invalid]="false"
[multiple]="true"
[dropzone]="true"
[showProgress]="true"
[size]="'md'"
[maxFiles]="3"
[maxFileSize]="1048576"
[accept]="'.txt,.pdf'"
[progress]="progress()"
[fileStates]="fileStates()"
[previewTemplate]="failurePreview"
[chooseLabel]="'Choose files'"
[clearLabel]="'Clear'"
[listAriaLabel]="'Selected files'"
[removeAriaLabel]="'Remove file'"
[retryLabel]="'Retry'"
[retryAriaLabel]="'Retry upload for'"
[acceptedTypesLabel]="'Allowed types'"
[fileCountSingularLabel]="'file'"
[fileCountPluralLabel]="'files'"
(filesRejected)="record('filesRejected', $event)"
(filesSelected)="record('filesSelected', $event.map(fileName))"
(fileRetry)="retry($event)"
[dropzoneLabel]="'Drop files to add them'"
[duplicateFileMessage]="'File already selected.'"
[emptySelectionMessage]="'No files selected.'"
[invalidTypeMessage]="'File type is not allowed.'"
[label]="'Attachments'"
[maxFileSizeMessage]="'File exceeds the maximum size.'"
[maxFileSizeTextLabel]="'Maximum size'"
[maxFilesMessage]="'Too many files selected.'"
[placeholder]="'Drop files here or choose them'"
[progressLabel]="'Upload progress'"
/>
<div class="remaining-actions">
<button
neu-button
variant="outline"
[disabled]="disabled() || readonly()"
(neuClick)="sample()"
>
{{ t("Add sample file", "Aรฑadir archivo de ejemplo") }}</button
><button neu-button variant="ghost" [disabled]="disabled() || readonly() || !value().length" (neuClick)="simulate()">
{{ t("Toggle sample progress", "Alternar progreso de ejemplo") }}
</button>
</div>
<ng-template #failurePreview let-item>
<button neu-button variant="outline" tone="danger" size="sm"
[ariaLabel]="t('Simulate upload failure for', 'Simular fallo de subida de') + ' ' + item.name"
[disabled]="disabled() || readonly() || item.status === 'error'"
(neuClick)="simulateFailure(item)"
>{{ t('Fail', 'Fallar') }}</button>
</ng-template>
State and events
Accessibility and keyboard
API
Inputs
Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
Models
A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.
Outputs
Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
Templates
ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.
previewTemplate
previewTemplate
Choose files
Drop files here or choose them ยท Allowed types: .txt,.pdf ยท Maximum size: 1.0 MB
0 selected files
Events: 0
Public Types
Open a type to inspect its definition and interface fields.
Styles and tokens
Specific tokens
This component uses shared theme tokens rather than dedicated component hooks.
Shared tokens used
Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.