logo-icon
STW UI

FilePreview

FilePreview is used to display upload progress for files.

Usage

svelte
import { FilePreview } from 'stwui';
// OR
import FilePreview from 'stwui/file-preview'; // for tree shaking

Basic

  • Screenshot 2023-02-24 at 3.19.17 PM.png

    410.45 KB

  • Screenshot 2023-02-25 at 3.19.17 PM.png

    410.45 KB

With Status

  • Screenshot 2023-02-24 at 3.19.17 PM.png

    410.45 KB

    Uploading 25%

  • Screenshot 2023-02-25 at 3.19.17 PM.png

    410.45 KB

    Pending Upload

Kitchen Sink

  • Screenshot 2023-02-24 at 3.19.17 PM.png

    410.45 KB

    Uploading 25%

    Tap to cancel

  • Screenshot 2023-02-25 at 3.19.17 PM.png

    410.45 KB

    Pending Upload

    Tap to cancel

FilePreview Props

divided boolean true
bordered boolean false
edgeToEdge boolean false

FilePreview Slots

default <FilePreview.Item />

FilePreview.Item Slots

leading <List.Item.Leading slot="leading" />
file-content <FilePreview.Item.FileContent slot="file-content" />
upload-content <FilePreview.Item.UploadContent slot="upload-content" />
default <FilePreview.Item.Extra slot="extra" />

FilePreview.Item.Leading Slots

icon <FilePreview.Item.Leading.Icon slot="icon" />
avatar <FilePreview.Item.Leading.Avatar slot="avatar" />
default

FilePreview.Item.Leading.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

FilePreview.Item.Leading.Avatar Props

src string
alt user-avatar
size 'xs' | 'sm' | 'md' | 'lg' | 'xl' md
placeholder boolean true

FilePreview.Item.FileContent Slots

title <FilePreview.Item.FileContent.Title slot="title" />
description <FilePreview.Item.FileContent.Description slot="description" />
default

FilePreview.Item.FileContent.Title Slots

default

FilePreview.Item.FileContent.Description Slots

default

FilePreview.Item.UploadContent Slots

status <FilePreview.Item.UploadContent.Status slot="status" />
action <FilePreview.Item.UploadContent.Action slot="action" />

FilePreview.Item.UploadContent.Status Slots

default

FilePreview.Item.UploadContent.Action Slots

default

FilePreview.Item.Extra Props

placement 'start' | 'center' | 'end' start

FilePreview.Item.Extra Slots

pending <FilePreview.Item.Extra.Pending slot="pending" />
complete <FilePreview.Item.Extra.Complete slot="complete" />
uploading <FilePreview.Item.Extra.Uploading slot="uploading" />
failed <FilePreview.Item.Extra.Failed slot="failed" />
rejected <FilePreview.Item.Extra.Rejected slot="rejected" />
default

FilePreview Class Identifiers

stwui-file-preview
stwui-file-preview-item
stwui-file-preview-item-leading
stwui-file-preview-item-upload-content
stwui-file-preview-item-file-content
stwui-file-preview-item-extra
stwui-file-preview-item-leading-avatar-wrapper
stwui-file-preview-item-leading-avatar
stwui-file-preview-item-leading-avatar-placeholder
stwui-file-preview-item-file-content-title
stwui-file-preview-item-file-content-description
stwui-file-preview-item-upload-content-status
stwui-file-preview-item-upload-content-action
stwui-file-preview-item-extra-uploading
stwui-file-preview-item-extra-rejected
stwui-file-preview-item-extra-pending
stwui-file-preview-item-extra-failed
stwui-file-preview-item-extra-complete