SwiftUI.js
Components

ShareLink

ShareLink presents a platform share action. On the web it uses the Web Share API when available and falls back to opening shareable URLs.

ShareLink presents a platform share action. On the web it uses the Web Share API when available and falls back to opening shareable URLs.

Examples

Default

Preview unavailable for this example in the static docs build.

Show code
<ShareLink item="https://swiftuijs.evecalm.com/docs" subject="SwiftUI.js" message="Take a look">Share docs</ShareLink>

API

PropTypeRequiredDescription
itemstringYesThe item to share. A string URL is treated as the shared URL on the web.
subjectstringNoOptional subject/title passed to the share sheet.
messagestringNoOptional supporting message/text passed to the share sheet.

Inherits additional props from Omit<IBaseElementComponent<'button'>, 'type'>.

Overview

ShareLink presents a platform share action. On the web it uses the Web Share API when available and falls back to opening shareable URLs.

Notes

  • Use item for the canonical URL or text payload.
  • subject and message map to the web share title and text fields.

On this page