The read-only presentationStyle property of the ClipboardItem interface returns a string indicating how an item should be presented.
On this page
ClipboardItem: presentationStyle property
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
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
presentationStyle |
No | No | 87 | No | No | 13.1 | No | No | No | No | 13.4 | No |
See also
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/presentationStyle