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-layout-sdk

v1.1.22

Published

React components for JD SDK (Sitecore-like routing)

Downloads

3,535

Readme

React Layout SDK (JD Layout System)

The React Layout SDK is an enterprise-grade Frontend SDK designed to consume layout definitions from Strapi via the Strapi Layout Plugin. Inspired by robust headless ecosystems like Sitecore JSS, this SDK provides dynamic placeholder routing and a scaffold generator to stream-line Developer Experience (DX).

Installation

Install the package using your favorite package manager:

npm install react-layout-sdk

Quick Start (Project Scaffolding)

To quickly set up your Next.js project to work with the JD Layout System, run the init command at the root of your project:

npx react-layout-sdk init

What this does:

  1. Creates a src/components/factory.tsx file for component mapping.
  2. Generates base boilerplate components like Header.tsx and Footer.tsx.
  3. Auto-configures your Next.js App Router (app/[[...slug]]/page.tsx) or Pages Router to catch all layout routes and fetch them dynamically using fetchJDLayout.

Component Scaffolding

You can scaffold new React components and automatically map them to their corresponding Strapi components in factory.tsx using the generate command:

npx react-layout-sdk generate component <strapi-component-uid>

Example:

npx react-layout-sdk generate component blocks.hero-banner

This command will:

  • Create src/components/HeroBanner.tsx.
  • Automatically inject import HeroBanner and map 'blocks.hero-banner': HeroBanner inside your factory.tsx.

API Reference

1. fetchJDLayout(apiUrl, slug, locale)

Fetches the layout structure and content from the Strapi backend.

import { fetchJDLayout } from 'react-layout-sdk';

const layoutData = await fetchJDLayout('http://localhost:1337', '/home', 'en');
const { route } = layoutData.strapi;

2. <Placeholder />

Renders a specific dynamic zone (like header, main, or footer) by matching the JSON data against your React components.

import { Placeholder } from 'react-layout-sdk';
import { componentMap } from '@/components/factory';

<main>
  <Placeholder 
    name="main" 
    rendering={route.placeholders.main || []} 
    componentMap={componentMap} 
  />
</main>

TypeScript Support

This package comes with full TypeScript definitions, including JDLayoutResponse, JDRoute, and JDContext.