💳 Subscription
The Subscription
component from @zezosoft/zezo-ott-react-native-ui-kit
delivers an elegant and animated carousel UI for subscription plans. It is theme-aware, responsive, and built for OTT experiences with clear call-to-actions and smooth transitions.
⚙️ Key Features
- 🎠 Carousel-based animated plan cards
- 💡 Displays benefits, pricing, duration & device support
- 🌗 Auto adapts to light/dark themes
- ⌛ Loading skeletons while fetching plans
- 🛎️
onSubscribe
event callback - ❌ Error fallback support for network/UI issues
🖼️ UI Previews
📡 API Call Methods
⚙️ First, set up the
getZezoOtt
API client: API Client Setup
🧪 Use the following API method to fetch subscription plans:
- 🔗
getZezoOtt().subscriptions.get()
— Fetch available subscription plans to display in the carousel.
🧑💻 Basic Usage
SubscriptionScreen.tsx
import React from "react";
import {
SafeAreaWrapper,
Subscription,
} from "@zezosoft/zezo-ott-react-native-ui-kit";
import { useState } from "react";
const SubscriptionScreen = () => {
const [subscribingId, setSubscribingId] = useState<string | null>(null);
const handleSubscribe = (plan: any) => {
setSubscribingId(plan.id);
setTimeout(() => {
console.log("✅ Subscribed to:", plan);
setSubscribingId(null);
}, 1000);
};
return (
<SafeAreaWrapper>
<Subscription.One
plans={
[] // Replace with actual API response from `getZezoOtt().subscriptions.get()`
}
isLoading={false}
header={{
topTitle: "Subscription",
title: "Subscribe to enjoy your lovely Movies or Series",
subTitle:
"We will help you book your lovely movies instantly and seamlessly. And it’s free!",
}}
footer={{
title:
"You will be charged ₹99 (monthly plan) or ₹609 (annual plan) through your payment account.",
subTitle: "You can cancel at any time if not satisfied.",
}}
onBackPress={() => console.log("🔙 Back pressed")}
subscribeLoadingId={subscribingId}
onSubscribe={handleSubscribe}
extraContentText="You can also subscribe to our newsletter to get the latest updates on new movies and series."
/>
</SafeAreaWrapper>
);
};
export default SubscriptionScreen;
🔧 Props Reference
Prop Name | Type | Description | |
---|---|---|---|
plans | Plan[] | List of plans to display in the carousel | |
isLoading | boolean | Shows loading state while plans are being fetched | |
theme | AppTheme | Optional theme override | |
header | object | Object with topTitle , title , and subTitle for the section headers | |
footer | object | Object with title and subTitle for the section footers | |
onBackPress | () => void | Callback triggered on back button press | |
onSubscribe | (plan: Plan) => void | Function fired when a plan is selected | |
subscribeLoadingId | `string \ | null` | Show loader on the currently selected plan’s subscribe button |
extraContentText | string | Optional paragraph text shown under the carousel | |
errorMessage | string | Custom message shown when there’s an error fetching plans |
🎯 Best Practices
- Use
react-query
or custom logic to fetch and pass plans - Display a custom error using
errorMessage
if plan fetch fails - Combine
extraContentText
with FAQs or coupons for better UX - Debounce the
onSubscribe
logic to avoid accidental multiple submissions - Highlight popular plans using the
isPopular
field
✍️ Created by Naresh Dhamu – Powered by ZezoSoft
Last updated on