Welcome to the React Native package development workspace. This project is structured as a Turborepo monorepo using Bun workspaces to build, test, and showcase customizable React Native libraries.
This workspace contains React Native libraries and application playgrounds:
@masumdev/rn-tajweed-verse- Description: A highly customizable React Native component (
TajweedVerse) designed to parse Quranic verses containing Tajweed markup tags (e.g.[q[خَلَقَ],[h:1[ٱ]) and render them with custom color schemes. - Key Features:
- Interactive Tooltips: Tapping a colored word reveals linguistic explanations and pronunciation guides.
- Multiple Theme Presets: Built-in themes (
classic,dark,pastel, andaccessible). - Plain Reading Mode: Easily toggle colors off to show clean, unstyled Arabic text.
- Custom Rule Injection: Inject custom RegExp patterns and styles (e.g. highlights).
- Performance Memoization: Uses
React.memowith custom shallow comparison checks to prevent redundant parsing cycles. - Style Inheritance Fix: Automatically resolves the React Native nested text bug where custom font family values fail to inherit down on Android/iOS.
- Description: A highly customizable React Native component (
@masumdev/react-native-qr-code-gen- Description: A modern, customizable QR code generator for React Native and Expo utilizing SVG with custom color gradients, logos, and custom eye shapes.
@masumdev/rn-ui- Description: A flat, token-driven React Native UI kit with composable core components, light/dark/system theme support, pluggable persistence, and pluggable font tokens.
- Key Features:
- Flat Design Defaults: No shadow/elevation by default, stronger border tokens, modern rounded corners, and semantic surfaces.
- Theme Tokens: Typed
colors,fonts,typography,spacing,radii,shadows, and component sizing tokens. - Light/Dark/System Mode: Uses React Native color scheme detection for
systemmode. - Pluggable Persistence: Accepts a
getItem/setItemstorage adapter, so apps can use SecureStore, AsyncStorage, MMKV, SQLite, or custom storage. - Pluggable Fonts: Apps load fonts with Expo Font, local TTF files, or React Native font linking, then pass registered names via the
fontstoken. - Core Components:
Box,Text,Button,IconButton,Badge,Card, andDivider.
typescript-config- Description: Shared TypeScript compiler configs used across packages.
native: An Expo app with Expo Router stack navigation that serves as an interactive playground.- Home / Dashboard: An elegant card-based menu to navigate between screen packages.
- RN UI Screen (
/rn-ui): Demonstrates all@masumdev/rn-uicore components, flat design tokens, light/dark/system controls, and reusable typography. - QR Code Screen (
/qr-code): Showcases QR code generator layouts. - Tajweed Verse Screen (
/tajweed-verse): Demonstrates theTajweedVersecomponent with live configurations:- Quran Database Samples: Select from 7 real Quran database verses (e.g. Al-Fatihah, Al-Baqarah) to test parsing behavior.
- 10 Premium Quranic Arabic Fonts: Instantly switch between Amiri, Amiri Quran, Noto Naskh Arabic, Scheherazade New, Mirza, Harmattan, Katibeh, Handjet, Reem Kufi Fun, Reem Kufi Ink, and System Default.
- Live Controls: Toggles for plain reading mode, interactive popups, color-coding, theme presets, custom rules, and a render-counter checking memoization efficiency.
web: A Next.js web application configured with react-native-web.
When changing a library API, theme token, default visual style, persistence behavior, dependency expectation, or playground integration, update the relevant package README.md in the same change.
packages/rn-ui/README.mdfor UI kit components, theme, fonts, persistence, logging, and usage examples.packages/rn-tajweed-verse/README.mdfor Tajweed rendering behavior and Arabic font handling.packages/react-native-qr-code-gen/README.mdfor QR code APIs and presets.- Root
README.mdfor monorepo-level package lists, playground screens, and shared workflow rules.
Run the install command from the root directory:
bun installLaunch the native Expo playground with Metro Bundler:
bun dev:native- Press
ato open in an Android Emulator. - Press
ito open in an iOS Simulator. - Scan the QR code with your Expo Go app to test on physical devices.
To build the packages using tsup compilers:
bun run buildClear build outputs and node_modules:
bun run cleanThis monorepo comes pre-configured with 10 custom Arabic fonts inside the native app. Here is how they are configured:
We use expo-font to register the .ttf assets located in assets/fonts/:
import { useFonts } from "expo-font";
const [loaded, error] = useFonts({
"Amiri-Regular": require("../assets/fonts/Amiri-Regular.ttf"),
"NotoNaskhArabic-Regular": require("../assets/fonts/NotoNaskhArabic-Regular.ttf"),
"ScheherazadeNew-Regular": require("../assets/fonts/ScheherazadeNew-Regular.ttf"),
// Mirza, Harmattan, Katibeh, AmiriQuran, Handjet, ReemKufi
});To apply a font, simply pass the fontFamily under the base text configuration:
<TajweedVerse
verse={verseText}
config={{
style: {
fontSize: 28,
fontFamily: "NotoNaskhArabic-Regular",
lineHeight: 60,
direction: "rtl",
},
}}
/>In React Native, nested <Text> components that have their own styling (e.g. different colors for Tajweed rules) fail to inherit fontFamily from their parent on Android and iOS.
Our @masumdev/rn-tajweed-verse package fixes this out-of-the-box by merging the base styling properties directly into the parsed sub-elements:
const getRuleStyle = (ruleStyle: StyleProp<TextStyle>) => {
return [mergedConfig.style, ruleStyle];
};This ensures consistent rendering of custom fonts across both plain text and colored tokens!