ClipboardItem.presentationStyle

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

Syntax

var presentationStyle = clipboardItem.presentationStyle;

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.

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 Status Comment
Clipboard API and events
The definition of 'ClipboardItem.presentationStyle' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also