Class UploaderTemplates
Inheritance
System.Object
UploaderTemplates
Namespace: Syncfusion.Blazor.Toolkit.Inputs
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class UploaderTemplates : ComponentBase
Constructors
UploaderTemplates()
Declaration
public UploaderTemplates()
Properties
Template
Gets or sets the template used to render custom content for uploaded files in the SfUploader component.
Declaration
public RenderFragment<FileInfo> Template { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Components.RenderFragment<FileInfo> | A Microsoft.AspNetCore.Components.RenderFragment<> of type FileInfo that defines the custom template content. The default value is |
Remarks
This property allows you to define a custom template for displaying uploaded files in the uploader component. The template receives a FileInfo context object that contains information about the uploaded file. When this property is set, the template will be applied to each file item in the uploader's file list.
Examples
The following example demonstrates how to use a custom template for file display:
<SfUploader>
<UploaderTemplates>
<Template>
<div class="custom-file-item">
<span>@context.Name</span>
<span>(@context.Size bytes)</span>
</div>
</Template>
</UploaderTemplates>
</SfUploader>
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |