OneScript

ShareLink

Share text or a URL with the share sheet.

A button that opens the system share sheet. Without children, it shows the standard localized Share button.

import { ShareLink } from "onescript/views"

<ShareLink
  item={new URL("https://onescript.define.to")}
  subject="OneScript"
  message="Write TypeScript, run native SwiftUI."
/>
PropTypeDescription
itemstring | URLThe text or URL to share.
subjectstringTitle used by destinations that support one, such as Mail.
messagestringNote shared along with the item.
childrenViewChildOptional custom label.
import { Label, ShareLink } from "onescript/views"

<ShareLink item={quote}>
  <Label symbol="quote.bubble">Share a quote</Label>
</ShareLink>

Also accepts Modifiers. It is only available in App and Action view sessions; widgets reject it with an unsupported view type error.

How is this guide?

Last updated on