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

@jiangtaste/layout-stack

v1.0.4

Published

SwiftUI-inspired layout components for React using Tailwind CSS

Downloads

7

Readme

🧱 layout-stack

A lightweight and reusable set of React layout components built with Tailwind CSS.

Includes: HStack, VStack, Stack, ZStack, and Spacer — inspired by layout patterns from SwiftUI, Figma, and other design tools.

📦 Installation

npm install layout-stack

Or use Yarn / pnpm:

yarn add layout-stack
# or
pnpm add layout-stack

⚠️ Peer Dependencies:

  • React 18+
  • Tailwind CSS (make sure your project has it properly configured)
  • clsx is used internally and handled as a peer dependency

🚀 Quick Usage

import { HStack, VStack, Stack, ZStack, Spacer } from "layout-stack";

export default function Example() {
  return (
    <VStack spacing="4" className="w-full">
      <HStack spacing="2">
        <span>Item 1</span>
        <span>Item 2</span>
        <Spacer />
        <span>Right</span>
      </HStack>

      <ZStack className="h-32 bg-gray-100">
        <div className="bg-red-200">Layer 1</div>
        <div className="bg-green-200">Layer 2</div>
      </ZStack>
    </VStack>
  );
}

📚 Component Overview

HStack

Horizontally arranges children using flex-row and space-x-{spacing}.

<HStack spacing="4" className="bg-white">
  <div>Left</div>
  <div>Center</div>
  <div>Right</div>
</HStack>

VStack

Vertically arranges children using flex-col and space-y-{spacing}.

<VStack spacing="6">
  <div>Title</div>
  <div>Description</div>
</VStack>

Stack

Similar to VStack but aligns items with items-start.

<Stack spacing="3">
  <div>Item A</div>
  <div>Item B</div>
</Stack>

ZStack

Stacks elements on top of each other with relative and absolute positioning.

<ZStack className="h-48">
  <div className="bg-blue-100" />
  <div className="bg-blue-300" />
</ZStack>

Spacer

Fills available space inside a flex container, equivalent to <div className="flex-1" />.

<HStack>
  <div>Left</div>
  <Spacer />
  <div>Right</div>
</HStack>

🧩 Export

You can import components individually or via the default export:

import LayoutStack from "layout-stack";
// or
import { HStack, VStack, Stack, ZStack, Spacer } from "layout-stack";

🛠️ Notes for Developers

  • Written in TypeScript with full type support
  • Tailwind utility classes are preserved in the output, ensure your host project has Tailwind properly configured

📄 License

MIT


Made with ❤️ by Jiangtaste