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 🙏

© 2025 – Pkg Stats / Ryan Hefner

group-tabs-layout

v0.0.5

Published

group tabs layout with Next.js dynamic routing

Readme

group tabs layout

group-tabs-layout is a state-driven UI library that integrates JSON data with Context API and dynamically renders MDX files using Next.js dynamic routing.

group_tabs_layout_demo

Install

pnpm add group-tabs-layout

Usage

"use client";

import Board from "group-tabs-layout";

const data = {
  blog: {
    selectedPageId: "page1",
    page: {
      page1: {
        id: "page1",
        groupIds: ["2a52-416f-876c-430502142051"],
        name: "page1",
      },
    },
    group: {
      "2a52-416f-876c-430502142051": {
        id: "2a52-416f-876c-430502142051",
        tabIds: ["eb7c60bd-5cf5-4872-9997-61c717b0f0c0", "5a76f275-0917-4d11-94cf-547b57be5fe6"],
        selectedTabId: "eb7c60bd-5cf5-4872-9997-61c717b0f0c0",
        size: {
          width: 400,
          height: 300,
        },
        prevSize: {
          width: 400,
          height: 300,
        },
        position: {
          x: 0,
          y: 0,
        },
        prevPosition: {
          x: 0,
          y: 0,
        },
      },
    },
    tab: {
      "eb7c60bd-5cf5-4872-9997-61c717b0f0c0": {
        id: "eb7c60bd-5cf5-4872-9997-61c717b0f0c0",
        groupId: "2a52-416f-876c-430502142051",
        name: "tab1",
        contentFile: "tab1.mdx",
      },
      "5a76f275-0917-4d11-94cf-547b57be5fe6": {
        id: "5a76f275-0917-4d11-94cf-547b57be5fe6",
        groupId: "ed3bc28c-f05c-4033-8545-3d7c16c56c07",
        name: "tab2",
        contentFile: "tab2.mdx",
      },
    },
  },
};

export default function GroupTabsLayout() {
  return (
    <Board.Root boardData={data} customConstants={{ TAB_SIZES: { WIDTH: 100, HEIGHT: 50 }, GROUP_MINIMUM_SIZE: { WIDTH: 200, HEIGHT: 300 } }}>
      <Board.Nav>
        <Board.NavList />
      </Board.Nav>
      <Board.Panel>
        <Board.GroupIndicate />
        <Board.Groups>
          <Board.Group mdxSources={mdxSources}>
            <Board.GroupHeader>
              <Board.Tab />
              <Board.TabIndicate />
            </Board.GroupHeader>
            <Board.TabContent>
              <CustomMDX />
            </Board.TabContent>
          </Board.Group>
        </Board.Groups>
      </Board.Panel>
    </Board.Root>
  );
}

API

Context API Integration

  • next-group-tabs-layout package uses Context API to manage boardData prop as a state and share it globally across components.

MDX Integration

  • Add the contentFile property to tab objects in the JSON data. Each contentFile should reference an MDX file.

  • Use a custom component like MdxRemote, to load and render the MDX content dynamically.

  • Pass mdxContent and groupId as props to the custom MDX component.

Board.Root

  • boardData: Data to initialize the layout.

  • customConstants: Object to configure constants such as tab sizes and minimum group size.

Styling

  • The package is built with Tailwind CSS. You can customize styles by overriding the provided class names.