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

@joshwilkerson/flex-ui

v1.0.0-alpha.0

Published

CSS-first responsive flexbox layouts with data attributes and optional React components

Readme

flex-ui

CSS-first responsive flexbox layouts using data attributes. Works with plain HTML or as React components.

Install

npm install flex-ui

CSS-Only Usage

Include the CSS and use data attributes directly on your HTML:

<link rel="stylesheet" href="node_modules/flex-ui/dist/flex-ui.css" />

<div data-flex data-axis="horizontal" data-gap="2" data-align="center">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</div>

Flex Container

Add the data-flex attribute and configure with data attributes:

| Attribute | Values | Description | |---|---|---| | data-axis | horizontal, vertical | Flex direction | | data-gap | 0-10, half, fourth | Gap between items | | data-row-gap | 0-10, half, fourth | Row gap | | data-column-gap | 0-10, half, fourth | Column gap | | data-justify | start, end, center, between, around, evenly | Main axis alignment | | data-align | start, end, center, stretch, baseline | Cross axis alignment | | data-align-content | start, end, center, stretch, between, around, evenly | Multi-line alignment | | data-wrap | nowrap, wrap, wrap-reverse | Wrap behavior | | data-reverse | (boolean) | Reverse direction | | data-inline | (boolean) | Use inline-flex |

Flex Item

Add the data-flex-item attribute to children for additional control:

| Attribute | Values | Description | |---|---|---| | data-grow | 0-5 | Flex grow | | data-shrink | 0-3 | Flex shrink | | data-basis | auto, 0, full, 1/2, 1/3, 2/3, 1/4, 3/4 | Flex basis | | data-align-self | auto, start, end, center, stretch, baseline | Override container alignment | | data-order | 1-12, first, last, none | Visual order |

Responsive

Append a breakpoint suffix to any attribute for responsive behavior:

<!-- Vertical on mobile, horizontal from md up -->
<div data-flex data-axis="vertical" data-axis-md="horizontal" data-gap="1" data-gap-lg="3">
  <div>Item 1</div>
  <div>Item 2</div>
</div>

Breakpoints: xs (480px), sm (600px), md (720px), lg (960px), xl (1200px)

React Components

Optional React wrapper that outputs the same data attributes:

import { Flex, FlexItem } from "flex-ui/react"
import "flex-ui" // include the CSS

<Flex axis="horizontal" gap={2} align="center">
  <FlexItem grow={1}>Main</FlexItem>
  <FlexItem basis="1/4">Sidebar</FlexItem>
</Flex>

Props accept responsive objects:

<Flex
  axis={{ base: "vertical", md: "horizontal" }}
  gap={{ base: 1, lg: 3 }}
>
  <FlexItem basis={{ base: "full", md: "1/2" }}>Half</FlexItem>
  <FlexItem basis={{ base: "full", md: "1/2" }}>Half</FlexItem>
</Flex>

Spacing Scale

The default spacing scale uses an 8px base unit:

| Key | Value | |---|---| | 0 | 0 | | fourth | 2px | | half | 4px | | 1 | 8px | | 2 | 16px | | 3 | 24px | | 4 | 32px | | 5 | 40px | | 6 | 48px | | 7 | 56px | | 8 | 64px | | 9 | 72px | | 10 | 80px |

Override spacing at runtime with CSS custom properties:

:root {
  --flex-spacing-2: 1rem;
  --flex-spacing-half: 0.125rem;
}

Customization

Generate a custom CSS file with your own breakpoints and spacing:

npx flex-ui

The interactive CLI walks you through:

  1. Adjusting breakpoint values (xs, sm, md, lg, xl)
  2. Setting a base spacing unit (e.g., 4px, 0.5rem)
  3. Choosing an output path

The generated CSS replaces the default flex-ui.css with your custom values.

License

MIT