npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-rn-story-editor

v0.2.4

Published

A React Native story editor with layers, drag-drop, text/image overlays, and export functionality

Readme

react-native-rn-story-editor

npm version License: MIT Platform - Android Platform - iOS

A powerful React Native story editor with layer management, drag-and-drop, text/image overlays, and export functionality. Built with React Native Fabric architecture for optimal performance.

Features

  • Layer Management - Add, edit, and delete text and image layers
  • Drag & Drop - Move layers around with touch gestures
  • Base Image Support - Set background images from base64
  • Text Layers - Add styled text with shadows and positioning
  • Image Overlays - Add overlay images with automatic scaling
  • Touch Interactions - Tap to edit/delete, drag to move
  • Export Options - Save to gallery or emit base64 to JavaScript
  • Fabric Architecture - Built with React Native's new rendering system
  • Cross-Platform - Works on both Android and iOS
  • TypeScript Support - Full type safety and IntelliSense

Installation

npm install react-native-rn-story-editor

Usage

import { useRef, useEffect } from 'react';
import { View, StyleSheet, DeviceEventEmitter } from 'react-native';
import {
  StoryEditorView,
  StoryEditorCommands,
} from 'react-native-rn-story-editor';

export default function App() {
  const editorRef = useRef(null);

  useEffect(() => {
    // Listen for export events
    const subscription = DeviceEventEmitter.addListener(
      'onExportImage',
      (event) => {
        console.log('Exported image base64:', event.image);
      }
    );
    return () => subscription.remove();
  }, []);

  return (
    <View style={styles.container}>
      <StoryEditorView
        ref={editorRef}
        colorString="#32a852"
        baseImage="data:image/png;base64,iVBORw0KGgo..."
        style={styles.editor}
      />

      {/* Export to gallery or get base64 */}
      <Button
        title="Export Image"
        onPress={() => StoryEditorCommands.exportImage(editorRef.current)}
      />

      {/* Show text input dialog */}
      <Button
        title="Add Text"
        onPress={() => StoryEditorCommands.showTextInput(editorRef.current)}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1 },
  editor: { width: 300, height: 400 },
});

Props

| Prop | Type | Default | Description | | ------------- | ----------- | ------------------- | ---------------------------------------------------------- | | color | number | Color.TRANSPARENT | Numeric color value (e.g., 0xFF32a852) | | colorString | string | undefined | Hex color string (e.g., "#32a852") | | baseImage | string | undefined | Base64 encoded background image (supports data URI format) | | addText | string | undefined | Add text layer programmatically | | addImage | string | undefined | Add overlay image from base64 (supports data URI format) | | style | ViewStyle | undefined | React Native style object |

Commands

| Command | Parameters | Description | | --------------- | ------------------ | ---------------------------------------------------------- | | exportImage | (ref: React.Ref) | Shows export dialog with gallery save and database options | | showTextInput | (ref: React.Ref) | Shows native text input dialog to add text layer |

Events

onExportImage

Emitted when user selects "Send to Database" in the export dialog.

DeviceEventEmitter.addListener('onExportImage', (event) => {
  // event.image contains the base64 string
  console.log(event.image);
});

Touch Interactions

  • Drag: Touch and hold to drag text/image layers around
  • Tap Text: Quick tap to open edit/delete dialog
  • Tap Image: Quick tap to open delete options
  • Stacking: Layers stack in order added, last added is on top

Export Options

When exportImage is called, users see a dialog with:

  • Download to Gallery: Saves the composed image to device photos
  • Send to Database: Emits onExportImage event with base64 data
  • Cancel: Dismiss the dialog

Testing

Unit Tests

npm test

Manual Testing

# Test on Android
npm run example:android

# Test on iOS
npm run example:ios

# Test different React Native versions
cd example
npm install [email protected]
npm install [email protected]

Cross-Platform Verification

  • Android: Tested on API 24+ (emulators/devices)
  • iOS: Test on iOS 12+ (simulators/devices)
  • React Native: Test with multiple versions
  • TypeScript: All types compile correctly
  • Props: Color, style, baseImage, addText, addImage
  • Commands: exportImage and showTextInput functions
  • Events: onExportImage event emission

Version History

0.2.0

  • Added layer management (text and image layers)
  • Added drag-and-drop functionality
  • Added base64 image support for backgrounds and overlays
  • Added export functionality (gallery save + base64 emission)
  • Added touch interactions (tap to edit, drag to move)
  • Fixed base64 data URI parsing
  • Improved event system for JavaScript communication

0.1.0

  • Initial release
  • Basic view component with color support
  • Native commands structure

Contributing

License

MIT


Made with create-react-native-library