Skip to Content

📝 BlogView

BlogView is a flexible and customizable blog viewer component designed for OTT-style React Native apps. It renders Markdown or HTML content with full support for theming, error/empty states, custom headers, and optional content overrides.


✨ Features

  • 🧾 Render content from Markdown or HTML sources
  • 🎨 Theme-aware (light/dark/custom)
  • 💨 Loading and empty state management
  • 🔧 Supports scrollable and non-scrollable modes
  • 🧱 Header override support with title or custom render
  • ⚙️ Custom renderers for content, header, and empty views

📸 Preview

BlogView-Light
BlogView-Dark

📱 API Call

🔗 Call your own blog API endpoint to fetch and pass content into the BlogView component.


🚀 Usage Example

BlogScreen.tsx
import React from "react"; import { SafeAreaWrapper, BlogView, } from "@zezosoft/zezo-ott-react-native-ui-kit"; import { goBack } from "@ZezoOtt/utils/NavigationUtil"; const BlogScreen = () => { return ( <SafeAreaWrapper> <BlogView content={} // your API response field: blog_content headerTitle={"Blog"} // your API response field: title isLoading={false} // your API response field: loading state emptyText="No blog found" onBackPress={() => goBack()} /> </SafeAreaWrapper> ); }; export default BlogScreen;

🔗 See related route definition: Route enum from @navigation/routes.ts


⚙️ Props

📌 Core Configuration

PropTypeDescription
contentstringBlog content in Markdown or HTML format
isLoadingbooleanShow loader when content is loading
emptyTextstringText shown when blog content is empty
themeAppThemeOptional theme override (light/dark/custom)

🧱 Header Config

PropTypeDescription
headerTitlestringText to display in the default header
onBackPress() => voidFunction triggered on back button press
onRightPress() => voidOptional function for right-side icon press
headerComponentReactNodeReplace default header with a custom one
renderHeader() => ReactNodeRender custom header via function

📜 Content Rendering

PropTypeDescription
scrollablebooleanEnable scroll view for content (default: true)
renderContent() => ReactNodeFully override content rendering
renderEmpty() => ReactNodeFully override empty state rendering

🎨 Styling Props

PropTypeDescription
containerStyleViewStyleStyle override for main container

🧠 Best Practices

  • ✅ Always sanitize and validate Markdown/HTML before rendering.
  • ✅ Use scrollable={false} when embedding in fixed-height modals or cards.
  • ✅ Use renderContent when embedding custom components like ads or polls.
  • ✅ Provide emptyText or renderEmpty to handle empty blog gracefully.
  • ✅ Use header overrides (renderHeader or headerComponent) for layout consistency with custom screens.

🖼️ Layout Overview

  • 🔙 Optional Back Button (default or custom)
  • 💼 Title or Custom Header
  • 📜 Scrollable or Static Blog Content
  • 💨 Loading Indicator (optional)
  • ❌ Empty State with fallback text or custom renderer

👍 Created by Naresh Dhamu – Powered by ZezoSoft.

Last updated on