Skip to main content
5.0.2Next5.1.05.0.35.0.25.0.15.0.04.0.94.0.84.0.73.2.03.1.03.0.13.0.02.1.12.0.101.0.0
Version: 5.0.2

Upload

The Upload component is a button that when clicked, lets users upload a file. Clicking the button will open a file explorer dialogue, where users can select the file to upload.

Basic Usage

<triton-upload></triton-upload>
<TritonUpload/>
<html> 
<head>
<script type="module">
import { defineCustomElements } from '~node_modules/@kognifai/triton-cl-core/loader/index.es2017.js';
defineCustomElements();
</script>
</head>
<body>
<triton-upload></triton-upload>
</body>
</html>

Behavior

Max Count

<triton-upload maxCount={1}></triton-upload>
<triton-upload maxCount={3}></triton-upload>

File Formats

<triton-upload 
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
></triton-upload>

Appearance

Skins

<triton-upload skin="primary"></triton-upload>
<triton-upload skin="secondary"></triton-upload>
<triton-upload skin="neutral"></triton-upload>
<triton-upload skin="flat"></triton-upload>

Settings

<triton-upload diabled></triton-upload>
<triton-upload></triton-upload>

API

Properties

PropertyDescriptionTypeDefault
acceptEnforces which file types to be acceptedstring'*/*'
disabledIf true, the component will look disabled and not be interactablebooleanfalse
fluidIf true, the element fills all available widthbooleanfalse
icon-leadingIcon to the left of textIcon-
icon-trailingIcon to the right of textIcon'cloud-upload'
labelIf set, this text will override the default Upload labelstring'Upload'
max-countMaximum simultaneous file upload countSet this to 0 if you dont want to keep track of loaded files.number10
sizeSet the size of the componentbase body large medium small tiny xlarge xxlarge xxxlarge'body'
skinSet the skin of the component from preset optionsThe skin determines how the component looksalarm critical flat information neutral primary secondary success warning'primary'

Events

NameTypeDescriptionExtra
atChangeCustomEvent<File[]>Array of files emitted on file upload-

Methods

FunctionDescriptionParamsExtra
resetProgrammatically reset the value of the component() => Promise<void>

Details

Depends on