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

@loyalid/layout-builder-rn

v1.3.2

Published

Loyalid Layout Builder — React Native renderer for mobile apps

Readme

@loyalid/layout-builder-rn

React Native renderer for Loyalid Layout Builder.

Install

npm install @loyalid/layout-builder-rn

Peer dependencies: react >= 16.8, react-native >= 0.60

Quick Start

import RNLayoutRenderer from '@loyalid/layout-builder-rn';

const layoutJSON = {
  general_style: {
    background_color: '#ffffff',
    padding: '24px',
    font_size: '16px',
    max_width: '760px',
    margin: '0 auto',
  },
  blocks: [
    { type: 'title', content: 'Hello World', level: 'h1', style: { color: '#1e293b' } },
    { type: 'paragraph', content: 'This is a paragraph.', style: { color: '#475569' } },
    { type: 'image', url: 'https://example.com/photo.jpg', alt: 'Photo' },
    { type: 'divider', style: { border_color: '#e2e8f0' } },
  ]
};

function App() {
  return <RNLayoutRenderer layoutJSON={layoutJSON} />;
}

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | layoutJSON | string \| object | ✅ | Layout JSON string or parsed object | | style | object | ❌ | Override outer container style | | components | object | ❌ | Custom block component overrides |

Custom Block Types

import { registerBlock } from '@loyalid/layout-builder-rn';

// Register a custom block component
registerBlock('video', VideoBlockComponent);
registerBlock('carousel', CarouselComponent);

// Now use in layout JSON
const layoutJSON = {
  blocks: [
    { type: 'video', url: 'https://...', style: {} },
  ]
};

Custom Components Override

Pass custom components directly via props (no global registration):

<RNLayoutRenderer
  layoutJSON={layoutJSON}
  components={{
    video: VideoBlockComponent,
    carousel: CarouselComponent,
  }}
/>

Utilities

import {
  mapStyle,           // Convert JSON styles → RN StyleSheet
  mapContainerStyle,  // Convert container-level styles
  mapBlockStyle,      // Convert block-level styles
  normalizeFontWeight, // Normalize font weight names
  getRegisteredTypes, // List all registered block types
} from '@loyalid/layout-builder-rn';

Style Mapping

All JSON style properties are automatically converted to React Native compatible styles:

| JSON Property | RN Output | |---------------|-----------| | font_size: '16px' | { fontSize: 16 } | | background_color: '#fff' | { backgroundColor: '#fff' } | | text_align: 'center' | { textAlign: 'center' } | | margin: '0 auto' | { marginLeft: 'auto', marginRight: 'auto' } | | border_left_color: '#3b82f6' | { borderLeftColor: '#3b82f6' } | | shadow_offset_x: 2 | { shadowOffset: { width: 2, height: ... } } |

Supported Block Types

| Type | Component | Description | |------|-----------|-------------| | title | RNTitle | Heading (h1–h6) with defaults | | paragraph | RNParagraph | Text block with selectable text | | quote | RNQuote | Blockquote with left border accent | | image | RNImage | Image with aspect ratio and alt text | | divider | RNDivider | Horizontal separator |

File Structure

src/
├── components/
│   ├── RNTitle.jsx         ← h1–h6 heading block
│   ├── RNParagraph.jsx     ← Text paragraph block
│   ├── RNQuote.jsx         ← Blockquote with citation
│   ├── RNImage.jsx         ← Image with alt text
│   ├── RNDivider.jsx       ← Horizontal divider
│   └── RNContainer.jsx     ← Scrollable wrapper
├── core/
│   ├── styleMapper.js      ← CSS → RN StyleSheet conversion
│   ├── blockMapper.js      ← Block type registry
│   └── index.js            ← Core exports
├── RNLayoutRenderer.jsx    ← Main renderer component
└── react-native.js         ← Package entry point