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

@bedrock-core/flexbox

v1.0.0

Published

@bedrock-core/ui flexbox layout engine

Readme

@bedrock-core/flexbox

Logo

A flexbox layout engine in pure TypeScript, sized for Minecraft Bedrock UI. It follows the CSS flexbox model — the same justifyContent / alignItems / flexGrow semantics you already know — over the subset that makes sense here: no grid, no floats, and display is only flex or none. Give it a tree of styled nodes and it resolves every box to absolute texel positions against the Bedrock pocket screen (320×210), with no dependencies and no build step.

This is a low-level engine. If you are building a Bedrock UI, use @bedrock-core/ui — it drives this engine for you. Reach for the package directly only when writing a custom renderer, a codegen tool, or another framework layer.

Install

yarn add @bedrock-core/flexbox

It also ships inside the umbrella package as @bedrock-core/ui/flexbox.

What it gives you

  • createNode(style?, children?, measure?) — build a layout node
  • computeLayout(root, refWidth?, refHeight?) — solve the tree in place
  • The CSS subset that matters: flexDirection, wrap, justifyContent, alignItems, alignContent, alignSelf, flex/flexGrow/flexShrink/flexBasis, gap/rowGap/ columnGap, padding and margin (texels or percent), min/max constraints, aspectRatio, position: 'absolute' with top/right/bottom/left insets, zIndex, display: 'none'
  • Content measurement — a leaf whose height depends on the width it is granted (wrapping text) supplies a MeasureFunc, and the solver runs a bounded fixpoint around it
  • SCREEN / CANONICAL_SCREEN reference dimensions, plus the isPercent / resolveSize helpers

Usage

import { computeLayout, createNode } from '@bedrock-core/flexbox';

const root = createNode({
  flexDirection: 'row',
  justifyContent: 'space-between',
  alignItems: 'center',
  padding: 10,
});

const sidebar = createNode({ width: 80 });
const content = createNode({ flex: 1 });

root.children.push(sidebar, content);

computeLayout(root); // defaults to the 320×210 pocket screen

sidebar.layout; // { x, y, width, height, zIndex } — absolute texels, rounded integers
content.layout;

node.layout is zeroed until computeLayout() runs. Pass explicit reference dimensions for other targets — computeLayout(root, SCREEN.DESKTOP.width, SCREEN.DESKTOP.height).

Documentation

  • flexbox — overview and screen constants
  • createNode — the full FlexStyle reference: every property, its type, its default
  • computeLayout — signature, worked examples, and the isPercent / resolveSize utilities

License

MIT