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

verband

v0.1.2

Published

Transform flat grid layouts to CSS Flexbox, Grid, or Yoga layouts

Readme

verband

Transform flat grid layouts to CSS Flexbox, Grid, or Yoga layouts

verband (German for "union, connection") bridges different layout systems by converting react-grid-layout format to various CSS layout outputs.

┌───────────────────────┐
│           H           │
├─────┬─────────────────┤       Flexbox
│  S  │        M        │  ───► CSS Grid
├─────┴─────────────────┤       Yoga (React Native)
│           F           │
└───────────────────────┘

Installation

pnpm add verband

Usage

Basic

import { LayoutConverter } from 'verband'

const layout = [
  { i: 'header', x: 0, y: 0, w: 12, h: 1 },
  { i: 'sidebar', x: 0, y: 1, w: 3, h: 3 },
  { i: 'main', x: 3, y: 1, w: 9, h: 3 },
  { i: 'footer', x: 0, y: 4, w: 12, h: 1 },
]

const converter = new LayoutConverter(layout, {
  cols: 12,
  rowHeight: 50,
  gap: { row: 10, column: 10 },
})

// Convert to different formats
const flexbox = converter.toFlexbox()
const cssGrid = converter.toCSSGrid()
const yoga = converter.toYoga()

Flexbox Output

const flexbox = converter.toFlexbox()
// {
//   container: { display: 'flex', flexDirection: 'column', gap: '10px' },
//   rows: [
//     {
//       style: { display: 'flex', gap: '10px', minHeight: '50px' },
//       items: [{ id: 'header', style: { flex: '12 1 0%' } }]
//     },
//     ...
//   ]
// }

CSS Grid Output

const cssGrid = converter.toCSSGrid()
// {
//   container: {
//     display: 'grid',
//     gridTemplateColumns: 'repeat(12, 1fr)',
//     gridTemplateRows: '50px 170px 50px',
//     gap: '10px 10px'
//   },
//   items: [
//     { id: 'header', style: { gridColumn: '1 / span 12', gridRow: '1' } },
//     ...
//   ]
// }

Yoga Output (React Native)

const yoga = converter.toYoga()
// {
//   root: {
//     flexDirection: 'column',
//     gap: 10,
//     children: [...]
//   }
// }

API

LayoutConverter

Main class for converting layouts.

new LayoutConverter(layout: FlatLayout, config: LayoutConfig)

Methods

| Method | Return Type | Description | | -------------- | ---------------- | ---------------------------------------- | | toFlexbox() | FlexboxLayout | Convert to CSS Flexbox | | toCSSGrid() | CSSGridLayout | Convert to CSS Grid | | toYoga() | YogaLayout | Convert to Yoga (React Native) | | toRowBased() | RowBasedLayout | Convert to row-based intermediate format |

Transform Functions

Individual transform functions are also exported:

import { flatToRowBased, rowBasedToFlexbox, rowBasedToCSSGrid, rowBasedToYoga } from 'verband'

Types

interface FlatLayoutItem {
  i: string // id
  x: number // column position
  y: number // row position
  w: number // width in columns
  h: number // height in rows
  minW?: number
  maxW?: number
  minH?: number
  maxH?: number
}

interface LayoutConfig {
  cols: number
  rowHeight: number
  gap: { row: number; column: number }
  padding?: { top: number; right: number; bottom: number; left: number }
}

Utilities

import { flatLayoutToAscii, calculateHeight } from 'verband'

// Visualize layout as ASCII art
console.log(flatLayoutToAscii(layout, 12))
// ┌───────────────────────┐
// │           H           │
// ├─────┬─────────────────┤
// │  S  │        M        │
// ├─────┴─────────────────┤
// │           F           │
// └───────────────────────┘

// Calculate total height in pixels
const height = calculateHeight(layout, { rowHeight: 50, gap: { row: 10 } })

License

MIT