View Source ShareLink

<ShareLink>

Opens a system share sheet when tapped.

Overview

Provide an item or list of items to share.

<ShareLink
    item="https://dockyard.com"
    subject="Check out DockYard's website"
    message="Here's a link to the DockYard homepage"
/>

Use a SharePreview element to override the title, image, and icon for an item.

<ShareLink
    item="https://dockyard.com"
    subject="Check out DockYard's website"
    message="Here's a link to the DockYard homepage"
>
    <SharePreview title="DockYard Homepage">
        <Image template={:image} name="dockyard" />
        <Image template={:icon} name="dockyard" />
    </SharePreview>
</ShareLink>

Use a JSON-encoded list of items to share multiple values. Set the item attribute of each SharePreview to connect it to the correct item.

<ShareLink
    items='["https://dockyard.com", "https://news.ycombinator.com", "https://apple.com"]'
    subject="Check out these websites"
    message="Here are links to our favorite websites"
>
    <SharePreview item="https://dockyard.com" title="DockYard">
        <Image template={:image} name="dockyard" />
        <Image template={:icon} name="dockyard" />
    </SharePreview>
    <SharePreview item="https://news.ycombinator.com" title="Hacker News">
        <Image template={:image} name="hackernews" />
        <Image template={:icon} name="hackernews" />
    </SharePreview>
    <SharePreview item="https://apple.com" title="Apple">
        <Image template={:image} name="apple" />
        <Image template={:icon} name="apple" />
    </SharePreview>
</ShareLink>

Attributes

References

A string to share.

The description to use when sharing to a service with a message field.

The title to use when sharing to a service with a subject field.