Package com.vaadin.flow.component.webshare
@NullMarked
package com.vaadin.flow.component.webshare
Server-side access to the browser's Web Share API, which opens the device's
native share sheet so the user can send a title, text, and/or URL to another
app.
Use
WebShare.onClick(component) to share when a component is clicked, building
the payload with ShareContent, and
WebShare.supportSignal() to check
whether sharing is available before showing a share button.
Sharing goes through onClick rather than an ordinary server-side
click listener because the browser only opens the share sheet while it is
handling a genuine user gesture, which is no longer valid by the time a
server round trip completes. The Web Share API also requires a secure context
(HTTPS or localhost) and is not available on every desktop browser.
-
ClassDescriptionEntry point for the browser's Web Share API (
navigator.share).Fluent surface returned fromWebShare.onClick(T), used to declare what a click should hand to the browser's native share sheet.Whether the browser exposes the Web Share API (navigator.share).