Mobile Native Share adds a native share button to Drupal entities, leveraging the Web Share API with graceful fallbacks for unsupported browsers.
Features
- Provides a configurable share button for multiple entity types.
- Works out of the box with nodes, taxonomy terms, and comments.
- Extendable to additional entity types (e.g. paragraphs or custom) via
hook_mobile_native_share_entity_types_alter. - Graceful fallback logic - uses Web Share API when available, falls back to Clipboard API or prompt dialog otherwise
- Configurable title and description per bundle of entity.
- Global configuration for icon and style.
- Token support for dynamic values in titles and descriptions.
- Theme suggestions for entity type and bundle, allowing easy template overrides.
Developer API
The module provides a dedicated, heavily optimized rendering service (mobile_native_share.renderer). Developers can easily inject this service via Dependency Injection or call it directly via the \Drupal wrapper to generate the share button programmatically for custom blocks, controllers, or bespoke routes:
// 1. Render using a specific entity (node, term, etc.)
$share_button = \Drupal::service('mobile_native_share.renderer')->render($entity);
// 2. Or render without an entity (will automatically fallback to the current page title and URL)
$share_button = \Drupal::service('mobile_native_share.renderer')->render();
Configuration
- Navigate to Configuration → Search and metadata → Mobile Native Share or go directly to
/admin/config/search/mobile-native-share. - Enable the share button for the required entity types and bundles.
- Configure display options:Title and Description per entity/bundle (supports tokens), global Icon and Style settings.
- Adjust display modes to control where the share button appears.
Use cases
- Add a native share button to articles, taxonomy pages, or comment threads.
- Extend sharing to custom entities like paragraphs or bespoke content types.
- Ensure consistent UX across modern and legacy browsers.
Supporting organizations:
Test, Review
Test, Review
Project information
- Project categories: Search engine optimization (SEO)
101 sites report using this module
- Created by phthlaap on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
1.2.1
released 28 June 2026
Works with Drupal: ^10.1 || ^11 || ^12
Added automatic field definition cache invalidation upon saving module configuration, ensuring the "Manage display" form updates instantly without requiring a full cache rebuild.
Install:
Development version: 1.x-dev updated 28 Jun 2026 at 15:27 UTC




