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

@dynshift/layr

v1.0.2

Published

Flutter-inspired layout primitives for React

Readme

@dynshift/layr

Flutter-inspired layout primitives for React

npm version npm downloads license TypeScript

Documentation · GitHub · npm

Features

  • Flutter-inspired API — Familiar patterns for Flutter developers transitioning to React
  • Zero dependencies — Lightweight and fully tree-shakeable
  • TypeScript-first — Complete type definitions out of the box
  • React 18 & 19 — Optimized for modern React with full compatibility
  • Comprehensive styling — Decorations, shadows, gradients, and borders built-in
  • Flexible layouts — Stack, Row, Column with powerful alignment controls

Installation

npm install @dynshift/layr
# Using other package managers
pnpm add @dynshift/layr
yarn add @dynshift/layr
bun add @dynshift/layr

Quick Start

import { Container, Column, Row } from '@dynshift/layr';

export function Card() {
  return (
    <Container
      width={320}
      padding={24}
      decoration={{
        color: '#1a1a1a',
        borderRadius: 16,
        boxShadow: [{ color: 'rgba(0,0,0,0.2)', blurRadius: 12 }],
      }}
    >
      <Column spacing={12}>
        <Row spacing={8}>
          <Container width={40} height={40} color="#3b82f6" decoration={{ borderRadius: 8 }} />
          <span>Welcome to Layr</span>
        </Row>
        <p>Build layouts the Flutter way.</p>
      </Column>
    </Container>
  );
}

Components

Container

A versatile box with comprehensive styling options including padding, margin, decoration, shadows, gradients, and borders.

<Container
  width={200}
  height={100}
  padding={16}
  margin={8}
  color="#1a1a1a"
  decoration={{
    borderRadius: 12,
    boxShadow: [{ color: 'rgba(0,0,0,0.1)', blurRadius: 10 }],
  }}
>
  {children}
</Container>

Column

Displays children in a vertical arrangement with spacing and alignment controls.

<Column
  spacing={16}
  mainAxisAlignment={MainAxisAlignment.center}
  crossAxisAlignment={CrossAxisAlignment.start}
>
  {children}
</Column>

Row

Displays children in a horizontal arrangement with spacing and alignment controls.

<Row
  spacing={12}
  mainAxisAlignment={MainAxisAlignment.spaceBetween}
  crossAxisAlignment={CrossAxisAlignment.center}
>
  {children}
</Row>

Stack

Positions children in layers, enabling overlapping elements. Children are painted in order (first = bottom, last = top).

<Stack fit={StackFit.expand}>
  <Container color="#000" />
  <Positioned top={10} left={10}>
    <Container width={50} height={50} color="#fff" />
  </Positioned>
</Stack>

Positioned & PositionedFill

Absolute positioning within a Stack.

<Positioned top={0} right={0} bottom={0} left={0}>
  {children}
</Positioned>

<PositionedFill>
  {children}
</PositionedFill>

SizedBox

Constrains its child to a specific width and height. Useful as a spacer or for fixed-size containers.

<SizedBox width={100} height={100}>
  {children}
</SizedBox>

{/* As a spacer */}
<SizedBox height={20} />

Padding

A lightweight wrapper that applies padding to its child.

<Padding padding={16}>
  {children}
</Padding>

<Padding padding={{ horizontal: 20, vertical: 10 }}>
  {children}
</Padding>

Centre / Center

Centers its child both horizontally and vertically. Both spellings are supported.

<Centre>
  {children}
</Centre>

Advanced Usage

Edge Insets Helpers

Utility functions for creating padding and margin values in Flutter style.

import { EdgeInsetsAll, EdgeInsetsSymmetric, EdgeInsetsOnly } from '@dynshift/layr';

<Container padding={EdgeInsetsAll(16)} />
<Container padding={EdgeInsetsSymmetric({ horizontal: 20, vertical: 10 })} />
<Container margin={EdgeInsetsOnly({ top: 10, left: 20 })} />

Border Helpers

import { BorderAll, BorderRadiusCircular } from '@dynshift/layr';

<Container
  decoration={{
    border: BorderAll({ width: 2, color: '#3b82f6', style: 'solid' }),
    borderRadius: BorderRadiusCircular(12),
  }}
/>

Box Shapes

import { BoxShape } from '@dynshift/layr';

<Container
  width={100}
  height={100}
  decoration={{
    color: '#3b82f6',
    shape: BoxShape.circle,
  }}
/>

Alignment Enums

import { MainAxisAlignment, CrossAxisAlignment, StackFit } from '@dynshift/layr';

<Column mainAxisAlignment={MainAxisAlignment.spaceBetween}>
  {children}
</Column>

<Row crossAxisAlignment={CrossAxisAlignment.stretch}>
  {children}
</Row>

<Stack fit={StackFit.expand}>
  {children}
</Stack>

TypeScript Support

Full type definitions are included for all components and utilities:

import type {
  ContainerProps,
  ColumnProps,
  RowProps,
  StackProps,
  EdgeInsets,
  BoxDecoration,
  Alignment,
} from '@dynshift/layr';

Documentation

For complete documentation, examples, and API reference, visit layr.dynshift.com.

Contributing

Contributions are welcome. Please see the GitHub repository for guidelines.

License

MIT © 2025 DynShift & Nishan Bhuiya