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

@asnewyla/layout

v0.3.0

Published

Layout primitives with token-based spacing — flex-based Layout/Stack/Group and CSS-Grid-based Grid

Readme

@asnewyla/layout

Layout primitives — props instead of repeating raw flex/grid CSS in every consumer. Layout (direction/gap/align/justify/wrap) is flex-based, with Stack and Group as thin presets over it. Grid is a separate, CSS-Grid-based primitive for genuine 2D layouts (card grids, dashboards) that flex-wrap can't express well.

Install

npm install @asnewyla/layout

Import the stylesheet once, anywhere in your app:

import '@asnewyla/layout/styles.css';

Usage

import { Layout, Stack, Group } from '@asnewyla/layout';

// Generic — pick an axis explicitly
<Layout direction="horizontal" gap="md">
  <Button>Save</Button>
  <Button>Cancel</Button>
</Layout>

// Stack — always vertical
<Stack gap="lg">
  <Field label="Name" />
  <Field label="Email" />
</Stack>

// Group — always horizontal
<Group gap="sm" align="center">
  <Avatar />
  <span>Jordan</span>
</Group>

Props

| Prop | Type | Default | |---|---|---| | direction | 'vertical' \| 'horizontal' (Layout only — fixed on Stack/Group) | 'vertical' | | gap | 'sm' \| 'md' \| 'lg' | — (no gap) | | align | 'start' \| 'center' \| 'end' | — (browser default) | | justify | 'start' \| 'center' \| 'end' \| 'between' \| 'around' | — (browser default) | | wrap | boolean | false |

Stack and Group accept every Layout prop except direction, which is fixed.

Grid

A separate CSS-Grid primitive, not a Layout variant — it renders its own display: grid, not a flex container, so align/justify map to different CSS properties than they do on Layout (see below). Reach for it when you need genuine 2D layout — equal-height rows, explicit column tracks — that flex-wrap can't express well.

import { Grid } from '@asnewyla/layout';

// Equal-width columns
<Grid columns={3} gap="md">
  <Card>...</Card>
  <Card>...</Card>
  <Card>...</Card>
</Grid>

// Explicit column tracks
<Grid columns="200px 1fr 200px" gap="sm">
  <Sidebar />
  <Main />
  <Aside />
</Grid>

Grid props

| Prop | Type | Default | |---|---|---| | columns | number \| string — a number renders repeat(N, 1fr); a string is passed straight through as grid-template-columns (e.g. "200px 1fr 200px", "repeat(auto-fit, minmax(200px, 1fr))") | — (single column) | | gap | 'sm' \| 'md' \| 'lg' — same scale and tokens as Layout | — (no gap) | | align | 'start' \| 'center' \| 'end'align-items (vertical position of an item within its own cell) | — (browser default) | | justify | 'start' \| 'center' \| 'end'justify-items (horizontal position of an item within its own cell) — not justify-content; there's no 'between'/'around', since those distribute space across tracks, which isn't what per-item cell alignment does | — (browser default) |

Every other native <div> prop (className, style, id, aria-*, ...) is accepted and forwarded to the root element; a className you pass is merged with Grid's own, not replaced.

Theming

gap reads from @asnewyla/tokens the same way @asnewyla/button and @asnewyla/image do — optional import, works standalone with built-in fallbacks. Applies to both Layout's and Grid's gap prop identically.

License

MIT