s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Assets · Components

AttachmentPanel

Composes authorized attachment display and optional native upload.

Public export

typescript
import { AttachmentPanel } from '@happyvertical/smrt-assets/svelte';
Import path
@happyvertical/smrt-assets/svelte
Props
14
Props described
14 of 14
Bindable state
0
Callback events
1
Verified release
0.57.40

Props

NameTypeRequiredDescription
attachmentsreadonly AssetAttachment[]YesAuthorized attachments in display order.
titlestringNoOptional caller-localized heading.
showHistorybooleanNoWhether to display supplied version history.
messagestringNoCaller-localized load/error state.
loadingbooleanNoLoading presentation; existing items remain visible.
onremove(attachment: AssetAttachment) => void | Promise<void>NoHost remove handler. Providing it (or `removeAction`) renders a Remove button per top-level attachment, behind a confirmation. Wins over `removeAction` when both are given. A returned promise keeps every remove button disabled until it settles.
removeActionstringNoNative mode: URL receiving a POST of the attachment id after confirmation.
removeIdFieldstringNoNative field carrying the attachment `id`, default attachmentId.
removeIntentFieldstringNoNative submitter field name, default intent.
removeIntentstringNoNative submitter value, default remove.
removeHiddenFieldsreadonly AttachmentRequestField[]NoRequest/tenant/revision fields sent verbatim with a native removal.
removePendingbooleanNoCaller-owned pending state (for example a native request in flight); disables remove buttons.
density'comfortable' | 'touch'NoTouch-size controls; omit to inherit the ThemeProvider density.
uploadAttachmentUploadPropsNoOmit when uploads are unavailable.

Bindable state

This component has no bindable public state.

Callback events

  • onremove(attachment: AssetAttachment) => void | Promise<void>

Examples and explanation