ClipboardItem: presentationStyle property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The read-only presentationStyle property of the ClipboardItem interface returns a string indicating how an item should be presented.

For example, in some contexts an image might be displayed inline, while in others it might be represented as an attachment.

Value

One of either "unspecified", "inline" or "attachment".

Examples

In the below example, we're returning all items on the clipboard via the clipboard.read() method, then logging the presentationStyle property.

js
async function getClipboardContents() {
  try {
    const clipboardItems = await navigator.clipboard.read();

    for (const clipboardItem of clipboardItems) {
      console.log(clipboardItem.presentationStyle);
    }
  } catch (err) {
    console.error(err.name, err.message);
  }
}

Specifications

Specification
Clipboard API and events
# dom-clipboarditem-presentationstyle

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
presentationStyle
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 127 (Release date: 2024-06-11)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 127 (Release date: 2024-06-11)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also