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-button

Installation

1 · Add registry to components.json

2 · Install component

Examples

Default

Animates on press. Shows a checkmark in the shared state.

API Reference

PropTypeDescription
shared
booleanShows a checkmark in the confirmed/shared state.
sharedClassName
stringClass applied to the icon when in shared state.
shareData
WebShareDataData passed to navigator.share(). Triggers native sharing when supported.
onShareSuccess
() => voidCalled after a successful native share.
onShareError
(error: string) => voidCalled when native share throws (not user cancellation).