Description
Use an <sp-asset>
element to visually represent a file, folder or image in your application. File and folder representations will center themselves horizontally and vertically in the space provided to the element. Images will be contained to the element, growing to the element's full height while centering itself within the width provided.
Installation

yarn add @spectrum-web-components/asset
Import the side effectful registration of <sp-asset>
via:
import '@spectrum-web-components/asset/sp-asset.js';
When looking to leverage the Asset
base class as a type and/or for extension purposes, do so via:
import { Asset } from '@spectrum-web-components/asset';
Example
<sp-asset style="height: 128px">
<img src="https://picsum.photos/500/500" alt="Demo Image" />
</sp-asset>
File
<div class="flex">
<sp-asset variant="file"></sp-asset>
<sp-asset variant="file" label="Named File Asset"></sp-asset>
</div>
Folder
<div class="flex">
<sp-asset variant="folder"></sp-asset>
<sp-asset variant="folder" label="Named Folder Asset"></sp-asset>
</div>
1.6.0 (2025-05-01) — (f2b6a32)
Minor Fixes
- icons-workflow: added missing S2 icons
Patch Fixes
- slider: ensure tracks become properly rounded when offset variant is activated
- popover: prevent overflow clipping in Safari with translateZ and visible tips
- picker: fix focus to prevent setting focus on menu items when opened via mouse
- button: update deprecation warning to allow variant and static-color to coexist
- number-field: fix UI issues and improve width calculation
- tooltip: add DelayedTooltipWithOverlay story for handling interactions
- infield-button, number-field, textfield, search, styles: update disabled border colors and styling across components
- close-button, dropzone, illustrated-message, menu, status-light, styles, switch, table, tabs, toast, tooltip: remove unnecessary system theme references
- overlay: fix layout issues in Safari for nested trays in dialogs