MindeesUI
ComponentsButtons

Share Button

A button that opens the platform share sheet for a message or URL, with a leading share glyph and a Share default label.

ShareButton opens the native share sheet via React Native's Share API when pressed. Provide at least one of message or url; the optional title is used as the Android dialog title. It renders a leading share glyph by default and resolves the share result through onShared. It inherits base Button props except children and onPress.

Import

import { ShareButton } from '@mindees/ui';

Usage

<ShareButton
  message="Check out MindeesUI"
  url="https://mindees.dev"
  onShared={(result) => console.log(result)}
/>

Props

PropTypeDefaultDescription
messagestringText body to share. At least one of message/url.
urlstringURL to share. At least one of message/url.
titlestringOptional share dialog title (Android).
onShared(result: ShareAction) => voidCalled with the platform share result.
childrenReact.ReactNode'Share'Label text.

Inherits the remaining ButtonBaseProps (variant, tone, size, leading, etc.) except children and onPress.

Accessibility

ShareButton is a standard Button with accessibilityRole="button" and tap-target sizing. If neither message nor url is supplied the press is a no-op rather than crashing, and share-sheet dismissal or unsupported platforms are swallowed silently so callers are never interrupted by an error.

On this page