Skip to content

About

Ionic React Social Sharing Example: News Feed, Parallax Header & Native Share

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Ionic React Social Sharing

A sample Ionic React app that demonstrates a social-style news feed with post details, native sharing, and a parallax header effect. Built with Ionic 8, React 19, and Capacitor 8.

Features

  • Post list — Card-based feed with image, category, title, author, and summary
  • Post details — Full article view with scrollable content
  • Share a post — Native share sheet via @ionic-native/social-sharing (title, image, and source URL)
  • Parallax header — Collapsing hero image on the details screen using ionic-react-header-parallax
  • Type-safe props — Reusable component prop types via @ahmnouira/props (ItemProps, TitleProps)
  • Dark mode — System-aware theme via Ionic's dark palette

Demo

Existing YouTube demo: Watch on YouTube

Screenshots

Post list Post details (hero)
Post list feed Post details with parallax header
Parallax scroll Share & actions
Parallax header while scrolling Post details with action bar

Tech stack

Getting started

Prerequisites

  • Node.js 18+
  • npm (or yarn/pnpm)

For native sharing on a device, you also need:

Install & run (web)

git clone https://github.com/ahmnouira/ionic-react-social-sharing.git
cd ionic-react-social-sharing
npm install
npm run dev

Open the URL shown in the terminal (typically http://localhost:5173).

Build

npm run build
npm run preview   # preview production build

Tests

npm run test.unit   # Vitest unit tests
npm run test.e2e    # Cypress e2e tests
npm run lint        # ESLint

Project structure

src/
├── components/
│   ├── Post/          # Card UI for a single post
│   ├── PostItem/      # List row linking to post details
│   └── Lorem/         # Placeholder content on details page
├── pages/
│   ├── HomePage/      # Nested routes: list + details
│   ├── PostListPage/  # Feed of posts
│   └── PostDetailsPage/  # Detail view, parallax, share
├── services/
│   └── sharing.service.ts  # Native share wrapper
├── mocks/
│   └── posts.ts       # Sample BBC-style news data
└── models/
    └── post.ts        # Post type definition

How sharing works

Tapping the share icon on the post details screen calls share() in sharing.service.ts, which uses the native Social Sharing plugin:

SocialSharing.share("SocialSharingApp", title, file, url);

Sharing works on a real device or emulator with the native plugin configured. In the browser, the share action may not be available.

Related projects

About

Ionic React Social Sharing Example: News Feed, Parallax Header & Native Share

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages