Share Button
A progressively enhanced share button. When shareData is provided and the Web Share API is available the OS native sheet opens; otherwise onClick fires as a fallback.
core/share-buttonInstallation
1 · Add registry to components.json
2 · Install component
Examples
Default
Animates on press. Shows a checkmark in the shared state.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
shared | boolean | false | Shows a checkmark in the confirmed/shared state. |
sharedClassName | string | — | Class applied to the icon when in shared state. |
shareData | WebShareData | — | Data passed to navigator.share(). Triggers native sharing when supported. |
onShareSuccess | () => void | — | Called after a successful native share. |
onShareError | (error: string) => void | — | Called when native share throws (not user cancellation). |